migueldeguzmandev
commited on
Commit
•
2220a33
1
Parent(s):
169280e
Update app.py
Browse files
app.py
CHANGED
@@ -31,14 +31,14 @@ def generate_response(input_text, temperature):
|
|
31 |
|
32 |
# Decode the generated response
|
33 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
34 |
-
return response
|
35 |
|
36 |
# Create the Gradio interface
|
37 |
interface = gr.Interface(
|
38 |
fn=generate_response,
|
39 |
inputs=[
|
40 |
gr.Textbox(label="User Input"),
|
41 |
-
gr.Slider(minimum=0.
|
42 |
],
|
43 |
outputs=gr.Textbox(label="Model Response"),
|
44 |
title="Basemodel GPT2XL, for test purposes only",
|
|
|
31 |
|
32 |
# Decode the generated response
|
33 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
34 |
+
return response.replace(input_text, "").strip()
|
35 |
|
36 |
# Create the Gradio interface
|
37 |
interface = gr.Interface(
|
38 |
fn=generate_response,
|
39 |
inputs=[
|
40 |
gr.Textbox(label="User Input"),
|
41 |
+
gr.Slider(minimum=0.000000000000000000000000000000000001, maximum=1.0, value=0.7, step=0.1, label="Temperature"),
|
42 |
],
|
43 |
outputs=gr.Textbox(label="Model Response"),
|
44 |
title="Basemodel GPT2XL, for test purposes only",
|