Update app.py
Browse files
app.py
CHANGED
|
@@ -14,13 +14,14 @@ st.set_page_config(page_title="Chatbot Test", page_icon="🤖", layout="centered
|
|
| 14 |
if "messages" not in st.session_state:
|
| 15 |
st.session_state["messages"] = []
|
| 16 |
|
|
|
|
|
|
|
| 17 |
# Function to Fetch Response (Non-Streaming)
|
| 18 |
def fetch_response(prompt_text, api_key):
|
| 19 |
"""
|
| 20 |
Fetch full text response from the HF Inference Endpoint using the InferenceClient.
|
| 21 |
Returns the generated text as a whole.
|
| 22 |
"""
|
| 23 |
-
client = InferenceClient(SPACE_URL, token=api_key)
|
| 24 |
|
| 25 |
gen_kwargs = {
|
| 26 |
"max_new_tokens": 512,
|
|
|
|
| 14 |
if "messages" not in st.session_state:
|
| 15 |
st.session_state["messages"] = []
|
| 16 |
|
| 17 |
+
client = InferenceClient(SPACE_URL, token=HF_API_KEY)
|
| 18 |
+
|
| 19 |
# Function to Fetch Response (Non-Streaming)
|
| 20 |
def fetch_response(prompt_text, api_key):
|
| 21 |
"""
|
| 22 |
Fetch full text response from the HF Inference Endpoint using the InferenceClient.
|
| 23 |
Returns the generated text as a whole.
|
| 24 |
"""
|
|
|
|
| 25 |
|
| 26 |
gen_kwargs = {
|
| 27 |
"max_new_tokens": 512,
|