baconnier commited on
Commit
e69ee39
1 Parent(s): 3982c6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -107,6 +107,8 @@ class GradioInterface:
107
 
108
  with gr.Row():
109
  prompt_text = gr.Textbox(label="Type the prompt here")
 
 
110
  with gr.Row():
111
  meta_prompt_choice = gr.Radio(["star","done","physics","morphosis", "verse", "phor","bolism"], label="Choose Meta Prompt", value="star")
112
  refine_button = gr.Button("Refine Prompt")
@@ -193,15 +195,17 @@ class GradioInterface:
193
  self.interface.launch(share=share)
194
 
195
  metaprompt_explanations = {
196
- "star": "The ECHO (Enhanced Chain of Harmonized Optimization) method, which provides a comprehensive and structured approach to prompt refinement, including multiple stages of analysis, expansion, and synthesis.",
197
- "done": "A detailed, multi-step approach that emphasizes role-playing, structured output, and various advanced prompting techniques like Chain-of-Thought and Tree of Thoughts.",
198
- "physics": "A prompt enhancement method that focuses on role-playing, structured output, and incorporating multiple advanced prompting techniques such as Chain-of-Thought and Tree of Thoughts.",
199
- "morphosis": "A simplified approach that focuses on clear language, logical flow, and essential elements of prompt engineering without complex techniques.",
200
- "verse": "A structured method that emphasizes analyzing the initial prompt, evaluating its strengths and weaknesses, and refining it with a focus on information flow and versatility.",
201
- "phor": "An advanced prompt engineering approach that combines multiple techniques, including clarity enhancement, structural improvement, and various specialized prompting methods like Chain-of-Thought and Few-Shot Learning.",
202
- "bolism": "A prompt refinement method that emphasizes leveraging the autoregressive nature of language models, encouraging reasoning before conclusions, and providing detailed instructions for output formatting."
203
  }
204
 
 
 
205
  # Main code to run the application
206
  if __name__ == '__main__':
207
  meta_info=""
 
107
 
108
  with gr.Row():
109
  prompt_text = gr.Textbox(label="Type the prompt here")
110
+ with gr.Accordion("Meta Prompt explanation", open=False):
111
+ gr.Markdown(explanation_markdown)
112
  with gr.Row():
113
  meta_prompt_choice = gr.Radio(["star","done","physics","morphosis", "verse", "phor","bolism"], label="Choose Meta Prompt", value="star")
114
  refine_button = gr.Button("Refine Prompt")
 
195
  self.interface.launch(share=share)
196
 
197
  metaprompt_explanations = {
198
+ "star": "Use ECHO when you need a comprehensive, multi-stage approach for complex prompts. It's ideal for tasks requiring in-depth analysis, exploration of multiple alternatives, and synthesis of ideas. Choose this over others when you have time for a thorough refinement process and need to consider various aspects of the prompt.",
199
+ "done": "Opt for this when you want a structured approach with emphasis on role-playing and advanced techniques. It's particularly useful for tasks that benefit from diverse perspectives and complex reasoning. Prefer this over 'physics' when you need a more detailed, step-by-step refinement process.",
200
+ "physics": "Select this when you need a balance between structure and advanced techniques, with a focus on role-playing. It's similar to 'done' but may be more suitable for scientific or technical prompts. Choose this over 'done' for a slightly less complex approach.",
201
+ "morphosis": "Use this simplified approach for straightforward prompts or when time is limited. It focuses on essential improvements without complex techniques. Prefer this over other methods when you need quick, clear refinements without extensive analysis.",
202
+ "verse": "Choose this method when you need to analyze and improve a prompt's strengths and weaknesses, with a focus on information flow. It's particularly useful for enhancing the logical structure of prompts. Use this over 'morphosis' when you need more depth but less complexity than 'star'.",
203
+ "phor": "Employ this advanced approach when you need to combine multiple prompt engineering techniques. It's ideal for complex tasks requiring both clarity and sophisticated prompting methods. Select this over 'star' when you want a more flexible, technique-focused approach.",
204
+ "bolism": "Utilize this method when working with autoregressive language models and when the task requires careful reasoning before conclusions. It's best for prompts that need detailed output formatting. Choose this over others when the prompt's structure and reasoning order are crucial."
205
  }
206
 
207
+ explanation_markdown = "".join([f"- **{key}**: {value}\n" for key, value in metaprompt_explanations.items()])
208
+
209
  # Main code to run the application
210
  if __name__ == '__main__':
211
  meta_info=""