Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -245,51 +245,51 @@ input[type="radio"]:checked::after {
|
|
| 245 |
}
|
| 246 |
"""
|
| 247 |
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
)
|
| 260 |
-
meta_prompt_choice = gr.Radio(
|
| 261 |
-
["star","done","physics","morphosis", "verse", "phor","bolism","math","arpe"],
|
| 262 |
-
label="Choose Meta Prompt",
|
| 263 |
-
value="star",
|
| 264 |
-
elem_classes=["no-background", "radio-group"]
|
| 265 |
-
)
|
| 266 |
-
|
| 267 |
-
# Option 1: Put Examples here (before Meta Prompt explanation)
|
| 268 |
-
with gr.Accordion("Examples", open=False):
|
| 269 |
-
gr.Examples(
|
| 270 |
-
examples=[
|
| 271 |
-
["Write a story on the end of prompt engineering replaced by an Ai specialized in refining prompts.", "star"],
|
| 272 |
-
["Tell me about that guy who invented the light bulb", "physics"],
|
| 273 |
-
["Explain the universe.", "star"],
|
| 274 |
-
["What's the population of New York City and how tall is the Empire State Building and who was the first mayor?", "morphosis"],
|
| 275 |
-
["List American presidents.", "verse"],
|
| 276 |
-
["Explain why the experiment failed.", "morphosis"],
|
| 277 |
-
["Is nuclear energy good?", "verse"],
|
| 278 |
-
["How does a computer work?", "phor"],
|
| 279 |
-
["How to make money fast?", "done"],
|
| 280 |
-
["how can you prove IT0's lemma in stochastic calculus ?", "arpe"],
|
| 281 |
-
],
|
| 282 |
-
inputs=[prompt_text, meta_prompt_choice]
|
| 283 |
)
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
|
| 294 |
with gr.Column(elem_classes=["container", "analysis-container"]):
|
| 295 |
gr.Markdown(' ')
|
|
|
|
| 245 |
}
|
| 246 |
"""
|
| 247 |
|
| 248 |
+
with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as self.interface:
|
| 249 |
+
with gr.Column(elem_classes=["container", "title-container"]):
|
| 250 |
+
gr.Markdown("# PROMPT++")
|
| 251 |
+
gr.Markdown("### Automating Prompt Engineering by Refining your Prompts")
|
| 252 |
+
gr.Markdown("Learn how to generate an improved version of your prompts.")
|
| 253 |
+
|
| 254 |
+
with gr.Column(elem_classes=["container", "input-container"]):
|
| 255 |
+
prompt_text = gr.Textbox(
|
| 256 |
+
label="Type your prompt (or let it empty to see metaprompt)",
|
| 257 |
+
elem_classes="no-background",
|
| 258 |
+
lines=5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
)
|
| 260 |
+
meta_prompt_choice = gr.Radio(
|
| 261 |
+
["star","done","physics","morphosis", "verse", "phor","bolism","math","arpe"],
|
| 262 |
+
label="Choose Meta Prompt",
|
| 263 |
+
value="star",
|
| 264 |
+
elem_classes=["no-background", "radio-group"]
|
| 265 |
+
)
|
| 266 |
+
|
| 267 |
+
# Option 1: Put Examples here (before Meta Prompt explanation)
|
| 268 |
+
with gr.Accordion("Examples", open=False):
|
| 269 |
+
gr.Examples(
|
| 270 |
+
examples=[
|
| 271 |
+
["Write a story on the end of prompt engineering replaced by an Ai specialized in refining prompts.", "star"],
|
| 272 |
+
["Tell me about that guy who invented the light bulb", "physics"],
|
| 273 |
+
["Explain the universe.", "star"],
|
| 274 |
+
["What's the population of New York City and how tall is the Empire State Building and who was the first mayor?", "morphosis"],
|
| 275 |
+
["List American presidents.", "verse"],
|
| 276 |
+
["Explain why the experiment failed.", "morphosis"],
|
| 277 |
+
["Is nuclear energy good?", "verse"],
|
| 278 |
+
["How does a computer work?", "phor"],
|
| 279 |
+
["How to make money fast?", "done"],
|
| 280 |
+
["how can you prove IT0's lemma in stochastic calculus ?", "arpe"],
|
| 281 |
+
],
|
| 282 |
+
inputs=[prompt_text, meta_prompt_choice]
|
| 283 |
+
)
|
| 284 |
+
|
| 285 |
+
with gr.Accordion("Meta Prompt explanation", open=False):
|
| 286 |
+
gr.Markdown(explanation_markdown)
|
| 287 |
+
|
| 288 |
+
refine_button = gr.Button("Refine Prompt")
|
| 289 |
+
|
| 290 |
+
# Option 2: Or put Examples here (after the button)
|
| 291 |
+
# with gr.Accordion("Examples", open=False):
|
| 292 |
+
# gr.Examples(...)
|
| 293 |
|
| 294 |
with gr.Column(elem_classes=["container", "analysis-container"]):
|
| 295 |
gr.Markdown(' ')
|