Update app.py
Browse files
app.py
CHANGED
@@ -39,23 +39,17 @@ def generate(starting_text=None, choice=None, temp=None, top_p=None):
|
|
39 |
with gr.Blocks(theme=gr.themes.Soft()) as app:
|
40 |
starting_text = gr.Textbox(label="Starting text", value="cinta adalah")
|
41 |
choice = gr.Radio(["7M", "25M", "Info"], label="Select model", info="Built with the Phi-3 architecture", value='Info')
|
42 |
-
|
43 |
-
with gr.Row() as slider_options:
|
44 |
temp = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, step=0.1, value=0.7)
|
45 |
top_p = gr.Slider(label="Top P", minimum=0.1, maximum=1.0, step=0.1, value=0.5)
|
46 |
-
|
47 |
res = gr.Textbox(label="Continuation")
|
48 |
-
|
49 |
gr.Interface(
|
50 |
fn=generate,
|
51 |
-
inputs=[starting_text, choice,
|
52 |
outputs=[res],
|
53 |
allow_flagging="never",
|
54 |
title="Sasando-1",
|
55 |
)
|
56 |
-
|
57 |
-
|
58 |
-
["gue"], ["presiden"], ["cinta adalah"], ["allah, aku"], ["dia marah karena"],
|
59 |
-
["inflasi"], ["kolam renang"], ["messi"], ["jalan-jalan"], ["komputer itu"]
|
60 |
-
], [starting_text])
|
61 |
app.launch()
|
|
|
39 |
with gr.Blocks(theme=gr.themes.Soft()) as app:
|
40 |
starting_text = gr.Textbox(label="Starting text", value="cinta adalah")
|
41 |
choice = gr.Radio(["7M", "25M", "Info"], label="Select model", info="Built with the Phi-3 architecture", value='Info')
|
42 |
+
with gr.Row():
|
|
|
43 |
temp = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, step=0.1, value=0.7)
|
44 |
top_p = gr.Slider(label="Top P", minimum=0.1, maximum=1.0, step=0.1, value=0.5)
|
|
|
45 |
res = gr.Textbox(label="Continuation")
|
|
|
46 |
gr.Interface(
|
47 |
fn=generate,
|
48 |
+
inputs=[starting_text, choice, temp, top_p],
|
49 |
outputs=[res],
|
50 |
allow_flagging="never",
|
51 |
title="Sasando-1",
|
52 |
)
|
53 |
+
examples = gr.Examples([["gue"], ["presiden"], ["cinta adalah"], ["allah, aku"], ["dia marah karena"],
|
54 |
+
["inflasi"], ["kolam renang"], ["messi"], ["jalan-jalan"], ["komputer itu"]], [starting_text])
|
|
|
|
|
|
|
55 |
app.launch()
|