Spaces:
Sleeping
Sleeping
vericudebuget
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -34,13 +34,6 @@ def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=904
|
|
34 |
yield output
|
35 |
return output
|
36 |
|
37 |
-
for response in stream:
|
38 |
-
output += response.token.text
|
39 |
-
if "http" in output: # assuming the AI writes a direct image link in its response
|
40 |
-
yield {"image": output} # Gradio will display the image
|
41 |
-
else:
|
42 |
-
yield output
|
43 |
-
|
44 |
additional_inputs = [
|
45 |
gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
|
46 |
gr.Slider(label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs"),
|
@@ -49,14 +42,14 @@ additional_inputs = [
|
|
49 |
gr.Slider(label="Repetition penalty", value=1.2, minimum=1.0, maximum=2.0, step=0.05, interactive=True, info="Penalize repeated tokens")
|
50 |
]
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
34 |
yield output
|
35 |
return output
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
additional_inputs = [
|
38 |
gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
|
39 |
gr.Slider(label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs"),
|
|
|
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 |
+
# Apply the Soft theme
|
46 |
+
gr.Interface.theme = gr.themes.Soft
|
47 |
+
|
48 |
+
gr.ChatInterface(
|
49 |
+
fn=generate,
|
50 |
+
chatbot=gr.Chatbot(show_label=True, show_share_button=True, show_copy_button=True, likeable=True, layout="panel"),
|
51 |
+
additional_inputs=additional_inputs,
|
52 |
+
title="ConvoLite",
|
53 |
+
description="Remember! The AI might give incorrect information about people, locations, history, etc...",
|
54 |
+
concurrency_limit=20,
|
55 |
+
).launch(show_api=False,)
|