Update app.py
Browse files
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)
|