Manofem commited on
Commit
31bf2e1
·
verified ·
1 Parent(s): cc0eed8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -7,11 +7,13 @@ llm = AutoModelForCausalLM.from_pretrained("TheBloke/WizardLM-7B-uncensored-GGUF
7
  history = ["Chatbot:"]
8
 
9
  def generate_response(message):
10
-
11
  for text in llm(message):
12
  response = ''.join(text)
13
  history.append(response)
14
  yield ' '.join(history)
 
 
15
 
16
  def chatbot(message, history):
17
  response_generator = generate_response(message)
 
7
  history = ["Chatbot:"]
8
 
9
  def generate_response(message):
10
+ global history
11
  for text in llm(message):
12
  response = ''.join(text)
13
  history.append(response)
14
  yield ' '.join(history)
15
+ # Clear the history list after the last response
16
+ history = ["Chatbot:"]
17
 
18
  def chatbot(message, history):
19
  response_generator = generate_response(message)