diff --git a/server.py b/server.py index d433747..9c4ea19 100644 --- a/server.py +++ b/server.py @@ -42,7 +42,7 @@ def download_model(repo: str, local_dir: Path) -> bool: print(f" Vui lòng đợi, quá trình này có thể mất vài phút...\n") cmd = [ - "huggingface-cli", "download", repo, + "hf", "download", repo, "--include", "*.litertlm", "--local-dir", str(local_dir) ] @@ -54,8 +54,8 @@ def download_model(repo: str, local_dir: Path) -> bool: print(f"\n ✗ Lỗi khi tải model: {e}") return False except FileNotFoundError: - print(f"\n ✗ Không tìm thấy huggingface-cli.") - print(f" Cài đặt bằng lệnh: pip install huggingface-hub") + print(f"\n ✗ Không tìm thấy lệnh 'hf'.") + print(f" Cài đặt bằng lệnh: pip install -U huggingface-hub") return False except Exception as e: print(f"\n ✗ Lỗi không xác định: {e}") @@ -86,7 +86,7 @@ def select_model() -> Path: if not model_path.exists(): print(f"\n Model chưa có trong thư mục models/") print(f" Lệnh tải thủ công:\n") - print(f" huggingface-cli download {info['repo']} \\") + print(f" hf download {info['repo']} \\") print(f" --include '*.litertlm' \\") print(f" --local-dir models/\n")