Reality123b commited on
Commit
39238d1
·
verified ·
1 Parent(s): 066d54e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -11,7 +11,7 @@ class XylariaChat:
11
 
12
  # Initialize the inference client
13
  self.client = InferenceClient(
14
- model="Qwen/QwQ-32B-Preview", # Changed model name to a placeholder
15
  token=self.hf_token
16
  )
17
 
@@ -172,7 +172,7 @@ Capabilities:
172
  }
173
  """
174
 
175
- with gr.Blocks(theme='soft', css=custom_css, js=local_storage_js) as demo:
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
- demo.load(
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(