Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -103,6 +103,16 @@ with gr.Blocks() as setting:
|
|
| 103 |
setting_mirostat_eta = gr.Number(label="Mirostat 学习率", interactive=True, **cfg['setting_mirostat_eta'])
|
| 104 |
setting_mirostat_tau = gr.Number(label="Mirostat 目标熵", interactive=True, **cfg['setting_mirostat_tau'])
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
# ========== 加载模型 ==========
|
| 107 |
model = StreamingLLM(model_path=setting_path.value,
|
| 108 |
seed=setting_seed.value,
|
|
|
|
| 103 |
setting_mirostat_eta = gr.Number(label="Mirostat 学习率", interactive=True, **cfg['setting_mirostat_eta'])
|
| 104 |
setting_mirostat_tau = gr.Number(label="Mirostat 目标熵", interactive=True, **cfg['setting_mirostat_tau'])
|
| 105 |
|
| 106 |
+
# ========== 下载模型 ==========
|
| 107 |
+
if os.path.exists(setting_path.value):
|
| 108 |
+
print(f"The file {setting_path.value} exists.")
|
| 109 |
+
else:
|
| 110 |
+
from huggingface_hub import snapshot_download
|
| 111 |
+
os.mkdir("downloads")
|
| 112 |
+
os.mkdir("cache")
|
| 113 |
+
snapshot_download(repo_id='TheBloke/CausalLM-7B-GGUF', local_dir=r'downloads',
|
| 114 |
+
allow_patterns='causallm_7b.Q5_K_M.gguf')
|
| 115 |
+
|
| 116 |
# ========== 加载模型 ==========
|
| 117 |
model = StreamingLLM(model_path=setting_path.value,
|
| 118 |
seed=setting_seed.value,
|