Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ class XylariaChat:
|
|
| 11 |
|
| 12 |
# Initialize the inference client
|
| 13 |
self.client = InferenceClient(
|
| 14 |
-
model="Qwen/
|
| 15 |
token=self.hf_token
|
| 16 |
)
|
| 17 |
|
|
@@ -172,7 +172,7 @@ Capabilities:
|
|
| 172 |
}
|
| 173 |
"""
|
| 174 |
|
| 175 |
-
with gr.Blocks(theme='soft', css=custom_css
|
| 176 |
# Chat interface with improved styling
|
| 177 |
with gr.Column():
|
| 178 |
chatbot = gr.Chatbot(
|
|
@@ -196,15 +196,8 @@ Capabilities:
|
|
| 196 |
clear = gr.Button("Clear Conversation")
|
| 197 |
clear_memory = gr.Button("Clear Memory")
|
| 198 |
|
| 199 |
-
# Load chat history from local storage on page load
|
| 200 |
-
|
| 201 |
-
fn=None,
|
| 202 |
-
_js="() => loadFromLocalStorage()"
|
| 203 |
-
).then(
|
| 204 |
-
fn=lambda x: x,
|
| 205 |
-
inputs=chatbot,
|
| 206 |
-
outputs=chatbot
|
| 207 |
-
)
|
| 208 |
|
| 209 |
# Submit functionality with local storage save
|
| 210 |
btn.click(
|
|
|
|
| 11 |
|
| 12 |
# Initialize the inference client
|
| 13 |
self.client = InferenceClient(
|
| 14 |
+
model="Qwen/Qwen-72B-Chat", # Changed model name
|
| 15 |
token=self.hf_token
|
| 16 |
)
|
| 17 |
|
|
|
|
| 172 |
}
|
| 173 |
"""
|
| 174 |
|
| 175 |
+
with gr.Blocks(theme='soft', css=custom_css) as demo:
|
| 176 |
# Chat interface with improved styling
|
| 177 |
with gr.Column():
|
| 178 |
chatbot = gr.Chatbot(
|
|
|
|
| 196 |
clear = gr.Button("Clear Conversation")
|
| 197 |
clear_memory = gr.Button("Clear Memory")
|
| 198 |
|
| 199 |
+
# Load chat history from local storage on page load using `gr.JSON`
|
| 200 |
+
chatbot.value = gr.JSON(value=loadFromLocalStorage())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
# Submit functionality with local storage save
|
| 203 |
btn.click(
|