Spaces:
Runtime error
Runtime error
Anonymous
commited on
Commit
·
780a591
1
Parent(s):
4092a79
new scheme
Browse files
app.py
CHANGED
|
@@ -36,34 +36,42 @@ def get_datasets(task):
|
|
| 36 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 37 |
with gr.Row():
|
| 38 |
gr.Markdown("## Multilingual Prompt Generator")
|
| 39 |
-
|
| 40 |
with gr.Row():
|
| 41 |
-
|
| 42 |
-
instruction = gr.Textbox(label="Instruction")
|
| 43 |
-
model_type = gr.Dropdown(label="Model Type", choices=["Multilingual", "English"], value='English')
|
| 44 |
-
config_recommendation = gr.Button("Recommend Configuration")
|
| 45 |
-
with gr.Column():
|
| 46 |
-
task = gr.Dropdown(label="Task", choices=list(tasks_datasets.keys()), value=QA)
|
| 47 |
-
language = gr.Dropdown(label="Source Language", choices=languages, value="English")
|
| 48 |
-
zero_shot = gr.Checkbox(label="Zero-shot", value=False)
|
| 49 |
-
with gr.Accordion("Prompt Configuration Selection", open=False):
|
| 50 |
-
prefix_selection = gr.Dropdown(["English", "Source"], label="prefix", value='English')
|
| 51 |
-
context_selection = gr.Dropdown(["English", "Source"], label="context", value='English')
|
| 52 |
-
examples_selection = gr.Dropdown(["English", "Source"], label="examples" , value='English')
|
| 53 |
-
output_selection = gr.Dropdown(["English", "Source"], label="output", value='English')
|
| 54 |
-
with gr.Accordion("Few Shot - Select Type of Examples ", open=False, visible=True) as few_shot:
|
| 55 |
-
dataset = gr.Dropdown(label="Dataset", choices=tasks_datasets[QA], value="XlSum")
|
| 56 |
-
num_examples = gr.Slider(label="Number of examples in context", minimum=1, maximum=10, step=1, value=3)
|
| 57 |
with gr.Row():
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
hypothesis = gr.Textbox(label="Hypothesis", visible=False)
|
| 63 |
-
premise = gr.Textbox(label="Premise", visible=False)
|
| 64 |
with gr.Row():
|
| 65 |
config_prompt = gr.Textbox(label="Recommended Configuration", interactive=False,
|
| 66 |
placeholder="Recommended Configuration for this scenerio")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
generate_button = gr.Button("Generate Prompt")
|
| 69 |
|
|
|
|
| 36 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 37 |
with gr.Row():
|
| 38 |
gr.Markdown("## Multilingual Prompt Generator")
|
|
|
|
| 39 |
with gr.Row():
|
| 40 |
+
gr.Markdown("### Task Details", elem_id="section-title") # Adding a small title
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
with gr.Row():
|
| 42 |
+
task = gr.Dropdown(label="Task", choices=list(tasks_datasets.keys()), value=QA)
|
| 43 |
+
language = gr.Dropdown(label="Source Language", choices=languages, value="English")
|
| 44 |
+
zero_shot = gr.Checkbox(label="Zero-shot", value=False)
|
| 45 |
+
config_recommendation = gr.Button("Recommend Configuration")
|
|
|
|
|
|
|
| 46 |
with gr.Row():
|
| 47 |
config_prompt = gr.Textbox(label="Recommended Configuration", interactive=False,
|
| 48 |
placeholder="Recommended Configuration for this scenerio")
|
| 49 |
+
with gr.Row():
|
| 50 |
+
with gr.Column(scale=3):
|
| 51 |
+
gr.Markdown("### Prompt Configuration", elem_id="section-title") # Adding a small title
|
| 52 |
+
# Set the same background style across all components
|
| 53 |
+
with gr.Group(elem_id="prompt-background"):
|
| 54 |
+
|
| 55 |
+
instruction = gr.Textbox(label="Instruction")
|
| 56 |
+
model_type = gr.Dropdown(label="Model Type", choices=["Multilingual", "English"], value='English')
|
| 57 |
+
with gr.Accordion("Few Shot - Select Type of Examples ", open=False, visible=True) as few_shot:
|
| 58 |
+
dataset = gr.Dropdown(label="Dataset", choices=tasks_datasets[QA], value="XlSum")
|
| 59 |
+
num_examples = gr.Slider(label="Number of examples in context", minimum=1, maximum=10, step=1,
|
| 60 |
+
value=3)
|
| 61 |
+
# Accordion for Prompt Configuration Selection
|
| 62 |
+
with gr.Accordion(label="Prompt Configuration Selection", open=False):
|
| 63 |
+
prefix_selection = gr.Dropdown(["English", "Source"], label="prefix", value='English')
|
| 64 |
+
context_selection = gr.Dropdown(["English", "Source"], label="context", value='English')
|
| 65 |
+
examples_selection = gr.Dropdown(["English", "Source"], label="examples", value='English')
|
| 66 |
+
output_selection = gr.Dropdown(["English", "Source"], label="output", value='English')
|
| 67 |
+
# Accordion for Few Shot example selection
|
| 68 |
+
with gr.Row():
|
| 69 |
+
question = gr.Textbox(label="Question", visible=True)
|
| 70 |
+
context = gr.Textbox(label="Context", visible=True)
|
| 71 |
+
text = gr.Textbox(label="Text", visible=False)
|
| 72 |
+
sentence = gr.Textbox(label="Sentence", visible=False)
|
| 73 |
+
hypothesis = gr.Textbox(label="Hypothesis", visible=False)
|
| 74 |
+
premise = gr.Textbox(label="Premise", visible=False)
|
| 75 |
|
| 76 |
generate_button = gr.Button("Generate Prompt")
|
| 77 |
|