Update README.md
Browse files
README.md
CHANGED
@@ -70,6 +70,7 @@ count_parameters(moe_model)
|
|
70 |
Download .py files
|
71 |
```
|
72 |
from huggingface_hub import HfApi, hf_hub_download
|
|
|
73 |
import os
|
74 |
import shutil
|
75 |
|
@@ -84,11 +85,11 @@ files_in_repo = api.list_repo_files(repo_id)
|
|
84 |
py_files = [file for file in files_in_repo if file.endswith('.py')]
|
85 |
|
86 |
# Directory to save the downloaded files
|
87 |
-
save_dir = "
|
88 |
-
os.makedirs(save_dir, exist_ok=True)
|
89 |
|
90 |
# Download each .py file
|
91 |
-
for file_name in py_files:
|
92 |
file_path = hf_hub_download(repo_id=repo_id, filename=file_name)
|
93 |
new_path = os.path.join(save_dir, file_name)
|
94 |
shutil.move(file_path, new_path)
|
@@ -102,7 +103,6 @@ Download models that will form the experts, as well as the base model
|
|
102 |
```python
|
103 |
from Phi_3V_MoE.moe_phi3_v import Phi3VForCausalLMMoE, Phi3VForCausalLMMoEConfig
|
104 |
|
105 |
-
|
106 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
107 |
|
108 |
model_name_1 = f"lamm-mit/Cephalo-Phi-3-vision-128k-4b-beta"
|
|
|
70 |
Download .py files
|
71 |
```
|
72 |
from huggingface_hub import HfApi, hf_hub_download
|
73 |
+
from tqdm.notebook import tqdm
|
74 |
import os
|
75 |
import shutil
|
76 |
|
|
|
85 |
py_files = [file for file in files_in_repo if file.endswith('.py')]
|
86 |
|
87 |
# Directory to save the downloaded files
|
88 |
+
save_dir = "."
|
89 |
+
#os.makedirs(save_dir, exist_ok=True)
|
90 |
|
91 |
# Download each .py file
|
92 |
+
for file_name in tqdm(py_files):
|
93 |
file_path = hf_hub_download(repo_id=repo_id, filename=file_name)
|
94 |
new_path = os.path.join(save_dir, file_name)
|
95 |
shutil.move(file_path, new_path)
|
|
|
103 |
```python
|
104 |
from Phi_3V_MoE.moe_phi3_v import Phi3VForCausalLMMoE, Phi3VForCausalLMMoEConfig
|
105 |
|
|
|
106 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
107 |
|
108 |
model_name_1 = f"lamm-mit/Cephalo-Phi-3-vision-128k-4b-beta"
|