Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import prompts
|
|
4 |
client = InferenceClient(
|
5 |
"mistralai/Mixtral-8x7B-Instruct-v0.1"
|
6 |
)
|
|
|
7 |
|
8 |
|
9 |
|
@@ -16,7 +17,7 @@ def format_prompt(message, history):
|
|
16 |
return prompt
|
17 |
|
18 |
def generate(
|
19 |
-
prompt, system_prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0, history=
|
20 |
):
|
21 |
system_prompt=prompts.WEB_DEV
|
22 |
temperature = float(temperature)
|
@@ -43,7 +44,6 @@ def generate(
|
|
43 |
return output
|
44 |
|
45 |
output = gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel")
|
46 |
-
|
47 |
additional_inputs=[
|
48 |
gr.Textbox(
|
49 |
label="Prompt",
|
@@ -86,7 +86,7 @@ additional_inputs=[
|
|
86 |
step=0.05,
|
87 |
interactive=True,
|
88 |
info="Penalize repeated tokens",
|
89 |
-
),
|
90 |
|
91 |
]
|
92 |
|
|
|
4 |
client = InferenceClient(
|
5 |
"mistralai/Mixtral-8x7B-Instruct-v0.1"
|
6 |
)
|
7 |
+
chat_state=gr.State()
|
8 |
|
9 |
|
10 |
|
|
|
17 |
return prompt
|
18 |
|
19 |
def generate(
|
20 |
+
prompt, system_prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0, history=chat_state,
|
21 |
):
|
22 |
system_prompt=prompts.WEB_DEV
|
23 |
temperature = float(temperature)
|
|
|
44 |
return output
|
45 |
|
46 |
output = gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel")
|
|
|
47 |
additional_inputs=[
|
48 |
gr.Textbox(
|
49 |
label="Prompt",
|
|
|
86 |
step=0.05,
|
87 |
interactive=True,
|
88 |
info="Penalize repeated tokens",
|
89 |
+
), chat_state
|
90 |
|
91 |
]
|
92 |
|