Update app.py
Browse files
app.py
CHANGED
@@ -5,18 +5,12 @@ import json
|
|
5 |
import time
|
6 |
from load_llms import model_choices, llm_intro, load_model
|
7 |
|
8 |
-
chat_history = []
|
9 |
|
10 |
# Construct chatbot
|
11 |
def generate_response(model_name, message, chat_history):
|
12 |
model = load_model(model_name)
|
13 |
-
|
14 |
-
|
15 |
-
input_text = past_chat + " " + message
|
16 |
-
else:
|
17 |
-
input_text = message
|
18 |
-
response = model.generate(input_text, max_tokens=100)
|
19 |
-
chat_history.append((input_text, response))
|
20 |
return "", chat_history
|
21 |
|
22 |
# Create Gradio UI
|
|
|
5 |
import time
|
6 |
from load_llms import model_choices, llm_intro, load_model
|
7 |
|
|
|
8 |
|
9 |
# Construct chatbot
|
10 |
def generate_response(model_name, message, chat_history):
|
11 |
model = load_model(model_name)
|
12 |
+
response = model.generate(message, max_tokens=100)
|
13 |
+
chat_history.append((message, response))
|
|
|
|
|
|
|
|
|
|
|
14 |
return "", chat_history
|
15 |
|
16 |
# Create Gradio UI
|