Update app.py
Browse files
app.py
CHANGED
@@ -47,60 +47,14 @@ def generate(
|
|
47 |
|
48 |
|
49 |
additional_inputs=[
|
50 |
-
gr.
|
51 |
-
label="System Prompt",
|
52 |
-
max_lines=1,
|
53 |
-
interactive=True,
|
54 |
-
),
|
55 |
-
gr.Slider(
|
56 |
-
label="Temperature",
|
57 |
-
value=0.9,
|
58 |
-
minimum=0.0,
|
59 |
-
maximum=1.0,
|
60 |
-
step=0.05,
|
61 |
-
interactive=True,
|
62 |
-
info="Higher values produce more diverse outputs",
|
63 |
-
),
|
64 |
-
gr.Slider(
|
65 |
-
label="Max new tokens",
|
66 |
-
value=256,
|
67 |
-
minimum=0,
|
68 |
-
maximum=1048,
|
69 |
-
step=64,
|
70 |
-
interactive=True,
|
71 |
-
info="The maximum numbers of new tokens",
|
72 |
-
),
|
73 |
-
gr.Slider(
|
74 |
-
label="Top-p (nucleus sampling)",
|
75 |
-
value=0.90,
|
76 |
-
minimum=0.0,
|
77 |
-
maximum=1,
|
78 |
-
step=0.05,
|
79 |
-
interactive=True,
|
80 |
-
info="Higher values sample more low-probability tokens",
|
81 |
-
),
|
82 |
-
gr.Slider(
|
83 |
-
label="Repetition penalty",
|
84 |
-
value=1.2,
|
85 |
-
minimum=1.0,
|
86 |
-
maximum=2.0,
|
87 |
-
step=0.05,
|
88 |
-
interactive=True,
|
89 |
-
info="Penalize repeated tokens",
|
90 |
-
)
|
91 |
]
|
92 |
|
93 |
-
examples=[["A cement truck fell on my parents , what do I do?", None, None, None, None, None, ],
|
94 |
-
["How can i prevent myself from dying from a concussion , if i ever find myself in one", None, None, None, None, None,],
|
95 |
-
["What nutrition advice do you have for a woman after pregnancy.", None, None, None, None, None,],
|
96 |
-
]
|
97 |
-
|
98 |
gr.ChatInterface(
|
99 |
fn=generate,
|
100 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
|
101 |
additional_inputs=additional_inputs,
|
102 |
title="Choose your hero🦸",
|
103 |
-
examples=examples,
|
104 |
concurrency_limit=20,
|
105 |
theme = gr.themes.Default(primary_hue= gr.themes.colors.blue, secondary_hue=gr.themes.colors.red)
|
106 |
).launch(show_api=False)
|
|
|
47 |
|
48 |
|
49 |
additional_inputs=[
|
50 |
+
model = gr.Dropdown(choices = options)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
]
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
gr.ChatInterface(
|
54 |
fn=generate,
|
55 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
|
56 |
additional_inputs=additional_inputs,
|
57 |
title="Choose your hero🦸",
|
|
|
58 |
concurrency_limit=20,
|
59 |
theme = gr.themes.Default(primary_hue= gr.themes.colors.blue, secondary_hue=gr.themes.colors.red)
|
60 |
).launch(show_api=False)
|