Ganesh Karbhari
commited on
Commit
•
d54eb9a
1
Parent(s):
3cea2d4
Update app.py
Browse files
app.py
CHANGED
@@ -181,7 +181,7 @@ def format_prompt(message, history):
|
|
181 |
return prompt
|
182 |
|
183 |
def generate(
|
184 |
-
prompt, history, temperature=0.3, max_new_tokens=3000, top_p=0.90, repetition_penalty=
|
185 |
):
|
186 |
temperature = float(temperature)
|
187 |
if temperature < 1e-2:
|
@@ -194,7 +194,7 @@ def generate(
|
|
194 |
top_p=top_p,
|
195 |
repetition_penalty=repetition_penalty,
|
196 |
do_sample=True,
|
197 |
-
seed=
|
198 |
)
|
199 |
|
200 |
formatted_prompt = format_prompt(prompt, history)
|
@@ -208,9 +208,9 @@ def generate(
|
|
208 |
return output
|
209 |
|
210 |
additional_inputs=[
|
211 |
-
gr.Slider(0, 1, 0
|
212 |
-
gr.Slider(
|
213 |
-
|
214 |
|
215 |
# [gr.Slider(
|
216 |
# [label="temperature",
|
@@ -245,9 +245,3 @@ demo = gr.ChatInterface(fn=generate,
|
|
245 |
)
|
246 |
|
247 |
demo.queue().launch(show_api=False)
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
|
|
181 |
return prompt
|
182 |
|
183 |
def generate(
|
184 |
+
prompt, history, temperature=0.3, max_new_tokens=3000, top_p=0.90, repetition_penalty=0.90,
|
185 |
):
|
186 |
temperature = float(temperature)
|
187 |
if temperature < 1e-2:
|
|
|
194 |
top_p=top_p,
|
195 |
repetition_penalty=repetition_penalty,
|
196 |
do_sample=True,
|
197 |
+
seed=50,
|
198 |
)
|
199 |
|
200 |
formatted_prompt = format_prompt(prompt, history)
|
|
|
208 |
return output
|
209 |
|
210 |
additional_inputs=[
|
211 |
+
gr.Slider(0, 1, 0.5, label="temperature"),
|
212 |
+
gr.Slider(500, 5000, 3000, label="max_new_tokens")
|
213 |
+
]
|
214 |
|
215 |
# [gr.Slider(
|
216 |
# [label="temperature",
|
|
|
245 |
)
|
246 |
|
247 |
demo.queue().launch(show_api=False)
|
|
|
|
|
|
|
|
|
|
|
|