Spaces:
Runtime error
Runtime error
Create download_model.py
Browse files- download_model.py +11 -0
download_model.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# download_model.py
|
| 2 |
+
import torch
|
| 3 |
+
from transformers import AutoModel, AutoTokenizer
|
| 4 |
+
|
| 5 |
+
model_id = "OpenGVLab/InternVL2_5-2B"
|
| 6 |
+
|
| 7 |
+
print(f"Downloading {model_id}...")
|
| 8 |
+
# Download model and tokenizer to the default cache directory
|
| 9 |
+
model = AutoModel.from_pretrained(model_id, trust_remote_code=True)
|
| 10 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 11 |
+
print("Download complete.")
|