Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,12 @@ api_key = os.getenv("HF_TOKEN")
|
|
| 12 |
client = InferenceClient(api_key=api_key)
|
| 13 |
|
| 14 |
# Streamlit app title
|
| 15 |
-
st.title("Serverless Inference API")
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# Create a text input area for user prompts
|
| 18 |
with st.form("my_form"):
|
| 19 |
text = st.text_area("Enter text:", "Tell me a short joke to make me laugh.")
|
|
|
|
| 12 |
client = InferenceClient(api_key=api_key)
|
| 13 |
|
| 14 |
# Streamlit app title
|
| 15 |
+
st.title("Serverless Inference API")
|
| 16 |
|
| 17 |
+
# Ensure the full_text key is initialized in session state
|
| 18 |
+
if "full_text" not in st.session_state:
|
| 19 |
+
st.session_state["full_text"] = ""
|
| 20 |
+
|
| 21 |
# Create a text input area for user prompts
|
| 22 |
with st.form("my_form"):
|
| 23 |
text = st.text_area("Enter text:", "Tell me a short joke to make me laugh.")
|