Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,20 +3,18 @@ import os
|
|
3 |
import subprocess
|
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 |
-
|
13 |
raise
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
PROJECT_ROOT = "projects"
|
19 |
-
AGENT_DIRECTORY = "agents"
|
20 |
AVAILABLE_CODE_GENERATIVE_MODELS = ["bigcode/starcoder", "Salesforce/codegen-350M-mono", "microsoft/CodeGPT-small"]
|
21 |
|
22 |
# Global state to manage communication between Tool Box and Workspace Chat App
|
|
|
3 |
import subprocess
|
4 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
5 |
from huggingface_hub import HfApi
|
|
|
6 |
import json
|
7 |
|
8 |
try:
|
9 |
huggingface_json = st.secrets["huggingface"]
|
10 |
+
huggingface_data = json.loads(huggingface_json)
|
11 |
+
huggingface_token = huggingface_data["hf_token"]
|
12 |
except Exception as e:
|
13 |
+
st.error(f"Unable to load secrets: {str(e)}")
|
14 |
raise
|
15 |
|
16 |
+
PROJECT_ROOT = "home/app/projects"
|
17 |
+
AGENT_DIRECTORY = "home/app/agents"
|
|
|
|
|
|
|
18 |
AVAILABLE_CODE_GENERATIVE_MODELS = ["bigcode/starcoder", "Salesforce/codegen-350M-mono", "microsoft/CodeGPT-small"]
|
19 |
|
20 |
# Global state to manage communication between Tool Box and Workspace Chat App
|