Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,13 @@ import gradio as gr
|
|
3 |
model = gr.load("models/mistralai/Mixtral-8x7B-Instruct-v0.1")
|
4 |
|
5 |
def chat(prompt, response_type):
|
|
|
|
|
6 |
if response_type == "Short":
|
7 |
-
|
8 |
elif response_type == "Medium":
|
9 |
-
|
10 |
-
|
11 |
-
return model(prompt, max_tokens=200)
|
12 |
|
13 |
demo = gr.Interface(
|
14 |
fn=chat,
|
|
|
3 |
model = gr.load("models/mistralai/Mixtral-8x7B-Instruct-v0.1")
|
4 |
|
5 |
def chat(prompt, response_type):
|
6 |
+
response = model(prompt)
|
7 |
+
max_tokens = 200
|
8 |
if response_type == "Short":
|
9 |
+
max_tokens = 50
|
10 |
elif response_type == "Medium":
|
11 |
+
max_tokens = 100
|
12 |
+
return response[:max_tokens]
|
|
|
13 |
|
14 |
demo = gr.Interface(
|
15 |
fn=chat,
|