Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,16 +21,17 @@ ai = aitextgen(model="chido/vggAI-offlinechat")
|
|
21 |
# repetition_penalty=1.25,
|
22 |
# )
|
23 |
|
24 |
-
def get_text(user_input = '', temp=0.8):
|
25 |
#result = generator(user_input, temperature=temp)
|
26 |
#return result[0]["generated_text"]
|
27 |
-
return ai.generate_one(prompt=user_input, max_length=256,
|
28 |
|
29 |
gr.Interface(
|
30 |
get_text,
|
31 |
inputs=[
|
32 |
gr.inputs.Textbox(lines=8,placeholder="Give a prompt and the AI will attempt to continue the conversation, or leave it blank to generate a conversation from scratch!", label="Prompt (optional)", default="chido: JAMMIES kickin in the front seat JAMMIES\nchido: JAMMIES sittin in the"),
|
33 |
-
gr.inputs.Slider(minimum=0.5, maximum=1.5, default=0.8, step=0.01, label='Temperature (controls “wildness” of output; recommended to set between 0.
|
|
|
34 |
],
|
35 |
outputs=gr.Textbox(),
|
36 |
title=title,
|
|
|
21 |
# repetition_penalty=1.25,
|
22 |
# )
|
23 |
|
24 |
+
def get_text(user_input = '', temp=0.8, rp=1.25):
|
25 |
#result = generator(user_input, temperature=temp)
|
26 |
#return result[0]["generated_text"]
|
27 |
+
return ai.generate_one(prompt=user_input, max_length=256, top_p=0.95, temperature=temp, repetition_penalty=rp)
|
28 |
|
29 |
gr.Interface(
|
30 |
get_text,
|
31 |
inputs=[
|
32 |
gr.inputs.Textbox(lines=8,placeholder="Give a prompt and the AI will attempt to continue the conversation, or leave it blank to generate a conversation from scratch!", label="Prompt (optional)", default="chido: JAMMIES kickin in the front seat JAMMIES\nchido: JAMMIES sittin in the"),
|
33 |
+
gr.inputs.Slider(minimum=0.5, maximum=1.5, default=0.8, step=0.01, label='Temperature (controls “wildness” of output; recommended to set between 0.7 and 1)'),
|
34 |
+
gr.inputs.Slider(minimum=1.0, maximum=1.5, default=1.25, step=0.01, label='Repetition penalty (the higher the value, the more it will try to avoid emote spamming and other repeating text)'),
|
35 |
],
|
36 |
outputs=gr.Textbox(),
|
37 |
title=title,
|