Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from huggingface_hub import get_secret, SecretNotFoundError
|
| 3 |
+
|
| 4 |
+
try:
|
| 5 |
+
print("Attempting to retrieve LLM_PROMPT...")
|
| 6 |
+
llm_prompt = get_secret("LLM_PROMPT")
|
| 7 |
+
print("LLM_PROMPT retrieved successfully.")
|
| 8 |
+
print(f"LLM_PROMPT value: {llm_prompt}")
|
| 9 |
+
# Now you can use llm_prompt in your code
|
| 10 |
+
except SecretNotFoundError:
|
| 11 |
+
print("LLM_PROMPT not found.")
|
| 12 |
+
st.error("LLM_PROMPT secret not found in Hugging Face secrets.")
|
| 13 |
+
|
| 14 |
+
# ... rest of your code ...
|