Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,10 @@
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import gradio as gr
|
3 |
import datetime
|
4 |
-
import random
|
5 |
|
6 |
# Initialize the InferenceClient
|
7 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
8 |
|
9 |
-
initial_messages = [
|
10 |
-
"message 1",
|
11 |
-
"message 2",
|
12 |
-
"message 3",
|
13 |
-
"message 4",
|
14 |
-
"message 5",
|
15 |
-
"message 6",
|
16 |
-
"message 7",
|
17 |
-
"message 8",
|
18 |
-
"message 9",
|
19 |
-
"message 10"
|
20 |
-
]
|
21 |
-
|
22 |
def format_prompt(message, history):
|
23 |
prompt = "<s>"
|
24 |
for user_prompt, bot_response in history:
|
@@ -56,21 +42,15 @@ additional_inputs = [
|
|
56 |
gr.Slider(label="Repetition penalty", value=1.2, minimum=1.0, maximum=2.0, step=0.05, interactive=True, info="Penalize repeated tokens")
|
57 |
]
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
concurrency_limit=20,
|
72 |
-
value=[[None, random_message]]
|
73 |
-
)
|
74 |
-
return chat
|
75 |
-
|
76 |
-
create_chat_interface().launch(show_api=False)
|
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import gradio as gr
|
3 |
import datetime
|
|
|
4 |
|
5 |
# Initialize the InferenceClient
|
6 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
def format_prompt(message, history):
|
9 |
prompt = "<s>"
|
10 |
for user_prompt, bot_response in history:
|
|
|
42 |
gr.Slider(label="Repetition penalty", value=1.2, minimum=1.0, maximum=2.0, step=0.05, interactive=True, info="Penalize repeated tokens")
|
43 |
]
|
44 |
|
45 |
+
gr.ChatInterface(
|
46 |
+
fn=generate,
|
47 |
+
chatbot=gr.Chatbot(show_label=True, show_share_button=False, show_copy_button=True, likeable=True, layout="panel", height="auto"),
|
48 |
+
additional_inputs=additional_inputs,
|
49 |
+
title="ConvoLite",
|
50 |
+
submit_btn="➢",
|
51 |
+
retry_btn="Retry",
|
52 |
+
undo_btn="↩ Undo",
|
53 |
+
clear_btn="Clear (New chat)",
|
54 |
+
stop_btn="Stop ▢",
|
55 |
+
concurrency_limit=20,
|
56 |
+
).launch(show_api=False)
|
|
|
|
|
|
|
|
|
|
|
|