clementrof commited on
Commit
81bd44c
·
verified ·
1 Parent(s): 1216ce9

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app5.py +4 -6
app5.py CHANGED
@@ -45,12 +45,9 @@ def clear_button_callback():
45
  # Generate a new unique ID when the clear button is clicked
46
  ID = generate_unique_id()
47
 
48
- # Update the ID in the chatbot response function
49
- chatbot.response_fn.keywords["ID"] = ID
50
 
51
- # Clear the textboxes
52
- msg.reset()
53
- chatbot.reset()
54
 
55
 
56
 
@@ -170,9 +167,10 @@ def Chat_call(chat,prompt):
170
 
171
  with gr.Blocks() as demo:
172
  chatbot = gr.Chatbot()
 
173
  msg = gr.Textbox(label = "Chat")
174
  prompt = gr.Textbox(label ="Prompt")
175
- clear = gr.ClearButton([msg, chatbot])
176
 
177
  def respond(message, chat_history,prompt):
178
  bot_message = Chat_call(message,prompt)
 
45
  # Generate a new unique ID when the clear button is clicked
46
  ID = generate_unique_id()
47
 
48
+ # Update the ID attribute in the chatbot object
49
+ chatbot.ID = ID
50
 
 
 
 
51
 
52
 
53
 
 
167
 
168
  with gr.Blocks() as demo:
169
  chatbot = gr.Chatbot()
170
+ chatbot.ID = 10 # Initialize the ID attribute
171
  msg = gr.Textbox(label = "Chat")
172
  prompt = gr.Textbox(label ="Prompt")
173
+ clear = gr.ClearButton([msg, chatbot,prompt])
174
 
175
  def respond(message, chat_history,prompt):
176
  bot_message = Chat_call(message,prompt)