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/Qwen-72B-Chat", # Changed model name
|
15 |
token=self.hf_token
|
16 |
)
|
17 |
|
@@ -200,14 +200,14 @@ Capabilities:
|
|
200 |
clear = gr.Button("Clear Conversation")
|
201 |
clear_memory = gr.Button("Clear Memory")
|
202 |
|
203 |
-
#
|
|
|
|
|
204 |
demo.load(
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
inputs=chatbot,
|
210 |
-
outputs=chatbot
|
211 |
)
|
212 |
|
213 |
# Submit functionality with local storage save
|
|
|
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 |
|
|
|
200 |
clear = gr.Button("Clear Conversation")
|
201 |
clear_memory = gr.Button("Clear Memory")
|
202 |
|
203 |
+
# Use `gr.State` to manage initial chatbot value and `demo.load` for initialization
|
204 |
+
initial_chat_history = gr.State([])
|
205 |
+
|
206 |
demo.load(
|
207 |
+
fn=lambda: initial_chat_history.value,
|
208 |
+
inputs=None,
|
209 |
+
outputs=[chatbot],
|
210 |
+
_js=load_from_local_storage_js
|
|
|
|
|
211 |
)
|
212 |
|
213 |
# Submit functionality with local storage save
|