Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,15 +10,16 @@ import streamlit as st
|
|
| 10 |
from transformers import pipeline, AutoModelForSeq2SeqLM, AutoTokenizer
|
| 11 |
from pylint import lint
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
hf_token =
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
except KeyError:
|
| 19 |
-
st.error("Hugging Face API key not found. Please configure it in your secrets.")
|
| 20 |
st.stop()
|
| 21 |
|
|
|
|
|
|
|
|
|
|
| 22 |
# Rest of your code here
|
| 23 |
st.write("Hugging Face API key successfully loaded!")
|
| 24 |
# Global state to manage communication between Tool Box and Workspace Chat App
|
|
|
|
| 10 |
from transformers import pipeline, AutoModelForSeq2SeqLM, AutoTokenizer
|
| 11 |
from pylint import lint
|
| 12 |
|
| 13 |
+
# Replace st.secrets with os.environ
|
| 14 |
+
hf_token = os.environ.get("huggingface_token")
|
| 15 |
+
|
| 16 |
+
if not hf_token:
|
| 17 |
+
st.error("Hugging Face API key not found. Please set the HUGGINGFACE_API_KEY environment variable.")
|
|
|
|
|
|
|
| 18 |
st.stop()
|
| 19 |
|
| 20 |
+
# Rest of your code here
|
| 21 |
+
st.write("Hugging Face API key successfully loaded!")
|
| 22 |
+
|
| 23 |
# Rest of your code here
|
| 24 |
st.write("Hugging Face API key successfully loaded!")
|
| 25 |
# Global state to manage communication between Tool Box and Workspace Chat App
|