Commit
·
89ed098
1
Parent(s):
018e32f
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,14 +79,28 @@ def bot(input_message: str, temperature=0.1, top_p=0.9, top_k=0, repetition_pena
|
|
| 79 |
gradio_interface = gr.Interface(
|
| 80 |
fn=bot,
|
| 81 |
inputs=[
|
| 82 |
-
"text",
|
| 83 |
gr.Slider(label="Temperature", minimum=0.0, maximum=1.0, value=0.1, step=0.1),
|
| 84 |
gr.Slider(label="Top-p (nucleus sampling)", minimum=0.0, maximum=1.0, value=0.9, step=0.01),
|
| 85 |
gr.Slider(label="Top-k", minimum=0, maximum=200, value=0, step=1),
|
| 86 |
gr.Slider(label="Repetition Penalty", minimum=1.0, maximum=2.0, value=1.08, step=0.1)
|
| 87 |
],
|
| 88 |
outputs="text",
|
| 89 |
-
title="
|
| 90 |
-
description="This
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
)
|
| 92 |
gradio_interface.launch()
|
|
|
|
| 79 |
gradio_interface = gr.Interface(
|
| 80 |
fn=bot,
|
| 81 |
inputs=[
|
| 82 |
+
gr.Textbox(default="Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average, minimum, and maximum age for all French singers? | stadium : stadium_id , location , name , capacity , highest , lowest , average | singer : singer_id , name , country , song_name , song_release_year , age , is_male | concert : concert_id , concert_name , theme , stadium_id , year | singer_in_concert : concert_id , singer_id | concert.stadium_id = stadium.stadium_id | singer_in_concert.singer_id = singer.singer_id | singer_in_concert.concert_id = concert.concert_id | ### Response: "),
|
| 83 |
gr.Slider(label="Temperature", minimum=0.0, maximum=1.0, value=0.1, step=0.1),
|
| 84 |
gr.Slider(label="Top-p (nucleus sampling)", minimum=0.0, maximum=1.0, value=0.9, step=0.01),
|
| 85 |
gr.Slider(label="Top-k", minimum=0, maximum=200, value=0, step=1),
|
| 86 |
gr.Slider(label="Repetition Penalty", minimum=1.0, maximum=2.0, value=1.08, step=0.1)
|
| 87 |
],
|
| 88 |
outputs="text",
|
| 89 |
+
title="SQL Skeleton WizardCoder Demo",
|
| 90 |
+
description="""This interactive tool translates natural language instructions into SQL queries, using a trained model. Type or paste your instructions into the text box and click 'Submit' to generate SQL queries. Use the sliders to adjust the model's temperature, top-p, top-k, and repetition penalty values.""",
|
| 91 |
+
examples=[
|
| 92 |
+
[
|
| 93 |
+
"Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average, minimum, and maximum age for all French singers? | stadium : stadium_id , location , name , capacity , highest , lowest , average | singer : singer_id , name , country , song_name , song_release_year , age , is_male | concert : concert_id , concert_name , theme , stadium_id , year | singer_in_concert : concert_id , singer_id | concert.stadium_id = stadium.stadium_id | singer_in_concert.singer_id = singer.singer_id | singer_in_concert.concert_id = concert.concert_id | ### Response: ",
|
| 94 |
+
0.1, 0.9, 0, 1.08
|
| 95 |
+
],
|
| 96 |
+
[
|
| 97 |
+
"Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show location and name for all stadiums with a capacity between 5000 and 10000. | stadium : stadium_id , location , name , capacity , highest , lowest , average | singer : singer_id , name , country , song_name , song_release_year , age , is_male | concert : concert_id , concert_name , theme , stadium_id , year | singer_in_concert : concert_id , singer_id | concert.stadium_id = stadium.stadium_id | singer_in_concert.singer_id = singer.singer_id | singer_in_concert.concert_id = concert.concert_id | ### Response: ",
|
| 98 |
+
0.1, 0.9, 0, 1.08
|
| 99 |
+
],
|
| 100 |
+
[
|
| 101 |
+
"Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the number of concerts that occurred in the stadium with the largest capacity ? | stadium : stadium_id , location , name , capacity , highest , lowest , average | singer : singer_id , name , country , song_name , song_release_year , age , is_male | concert : concert_id , concert_name , theme , stadium_id , year | singer_in_concert : concert_id , singer_id | concert.stadium_id = stadium.stadium_id | singer_in_concert.singer_id = singer.singer_id | singer_in_concert.concert_id = concert.concert_id | ### Response: ",
|
| 102 |
+
0.1, 0.9, 0, 1.08
|
| 103 |
+
]
|
| 104 |
+
]
|
| 105 |
)
|
| 106 |
gradio_interface.launch()
|