Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,19 @@ load_dotenv()
|
|
10 |
# Retrieve Hugging Face API token from environment variables
|
11 |
HF_API_TOKEN = os.getenv("HF_API_TOKEN")
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# Streamlit app setup
|
14 |
st.title('Llama2 Chatbot Deployment on Hugging Face Spaces')
|
15 |
st.write("This chatbot is powered by the Llama2 model. Ask me anything!")
|
|
|
10 |
# Retrieve Hugging Face API token from environment variables
|
11 |
HF_API_TOKEN = os.getenv("HF_API_TOKEN")
|
12 |
|
13 |
+
|
14 |
+
|
15 |
+
import os
|
16 |
+
|
17 |
+
# Access Hugging Face API Key from Hugging Face Secrets
|
18 |
+
HUGGINGFACE_API_KEY = os.getenv("HUGGINGFACE_API_KEY")
|
19 |
+
|
20 |
+
if not HUGGINGFACE_API_KEY:
|
21 |
+
raise ValueError("Hugging Face API Key not found. Please set it in the Hugging Face Secrets.")
|
22 |
+
|
23 |
+
# Now you can use the API key securely in your code
|
24 |
+
|
25 |
+
|
26 |
# Streamlit app setup
|
27 |
st.title('Llama2 Chatbot Deployment on Hugging Face Spaces')
|
28 |
st.write("This chatbot is powered by the Llama2 model. Ask me anything!")
|