Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,16 @@ import subprocess
|
|
4 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
5 |
from huggingface_hub import HfApi
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
PROJECT_ROOT = "projects"
|
11 |
AGENT_DIRECTORY = "agents"
|
|
|
4 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
5 |
from huggingface_hub import HfApi
|
6 |
|
7 |
+
import json
|
8 |
+
|
9 |
+
try:
|
10 |
+
huggingface_json = st.secrets["huggingface"]
|
11 |
+
except Exception as e:
|
12 |
+
print("Unable to load secrets: ", str(e))
|
13 |
+
raise
|
14 |
+
|
15 |
+
huggingface_data = json.loads(huggingface_json)
|
16 |
+
huggingface_token = huggingface_data["hf_token"]
|
17 |
|
18 |
PROJECT_ROOT = "projects"
|
19 |
AGENT_DIRECTORY = "agents"
|