Skip to content

Commit

Permalink
Fix: 細かな修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Dec 25, 2024
1 parent 27fa753 commit 01332ae
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions voicevox_engine/utility/user_agent_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ def get_gpu_names() -> list[str]:
return ["Unknown"]
elif os_name == "Linux":
try:
if not GPUtil:
return ["NoGPULib"]
gpus = GPUtil.getGPUs()
names = [gpu.name for gpu in gpus if hasattr(gpu, "name")]
return names if names else ["NoGPU"]
Expand All @@ -129,8 +127,6 @@ def get_memory_info() -> tuple[float | None, float | None]:
エラー時は None, None を返す。
"""
try:
if not psutil:
return None, None
vm = psutil.virtual_memory()
total_gb = round(vm.total / (1024**3), 1)
available_gb = round(vm.available / (1024**3), 1)
Expand Down Expand Up @@ -200,15 +196,9 @@ def is_docker() -> bool:
except Exception as e:
# 最悪の場合のフォールバック
logger.error("Failed to generate user agent string: %s", e)
fallback_agent = (
f"AivisSpeech-Engine/{__version__} "
f"(OS/Unknown; Arch/Unknown; "
f"CPU/Unknown; GPU/Unknown; "
f"Memory/Unknown; "
f"Inference/{inference_type})"
)
__user_agent_cache = fallback_agent
return fallback_agent
generic_user_agent = f"AivisSpeech-Engine/{__version__}"
__user_agent_cache = generic_user_agent
return generic_user_agent


if __name__ == "__main__":
Expand Down

0 comments on commit 01332ae

Please sign in to comment.