Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,16 @@
|
|
| 1 |
from huggingface_hub import snapshot_download
|
| 2 |
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
mistral_models_path = Path.home().joinpath('mistral_models', 'Mamba-Codestral-7B-v0.1')
|
| 5 |
mistral_models_path.mkdir(parents=True, exist_ok=True)
|
| 6 |
|
| 7 |
-
snapshot_download(repo_id="mistralai/Mamba-Codestral-7B-v0.1",
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
import gradio as gr
|
| 10 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 1 |
from huggingface_hub import snapshot_download
|
| 2 |
from pathlib import Path
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
TOKEN = os.getenv('HF_TOKEN')
|
| 6 |
|
| 7 |
mistral_models_path = Path.home().joinpath('mistral_models', 'Mamba-Codestral-7B-v0.1')
|
| 8 |
mistral_models_path.mkdir(parents=True, exist_ok=True)
|
| 9 |
|
| 10 |
+
snapshot_download(repo_id="mistralai/Mamba-Codestral-7B-v0.1",
|
| 11 |
+
allow_patterns=["params.json", "consolidated.safetensors", "tokenizer.model.v3"],
|
| 12 |
+
local_dir=mistral_models_path,
|
| 13 |
+
token=TOKEN)
|
| 14 |
|
| 15 |
import gradio as gr
|
| 16 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|