Warning: 'huggingface-cli download' is deprecated. Use 'hf download' instead.

This commit is contained in:
2026-04-20 20:41:41 +07:00
parent dee7e6e960
commit 4b1fd185d7
+4 -4
View File
@@ -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") print(f" Vui lòng đợi, quá trình này có thể mất vài phút...\n")
cmd = [ cmd = [
"huggingface-cli", "download", repo, "hf", "download", repo,
"--include", "*.litertlm", "--include", "*.litertlm",
"--local-dir", str(local_dir) "--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}") print(f"\n ✗ Lỗi khi tải model: {e}")
return False return False
except FileNotFoundError: except FileNotFoundError:
print(f"\n ✗ Không tìm thấy huggingface-cli.") print(f"\n ✗ Không tìm thấy lệnh 'hf'.")
print(f" Cài đặt bằng lệnh: pip install huggingface-hub") print(f" Cài đặt bằng lệnh: pip install -U huggingface-hub")
return False return False
except Exception as e: except Exception as e:
print(f"\n ✗ Lỗi không xác định: {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(): if not model_path.exists():
print(f"\n Model chưa có trong thư mục models/") print(f"\n Model chưa có trong thư mục models/")
print(f" Lệnh tải thủ công:\n") 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" --include '*.litertlm' \\")
print(f" --local-dir models/\n") print(f" --local-dir models/\n")