Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ class GradioInterface:
|
|
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="
|
112 |
refine_button = gr.Button("Refine Prompt")
|
113 |
with gr.Row():
|
114 |
gr.Markdown("### Initial prompt analysis")
|
@@ -192,8 +192,19 @@ class GradioInterface:
|
|
192 |
def launch(self, share=False):
|
193 |
self.interface.launch(share=share)
|
194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
# Main code to run the application
|
196 |
if __name__ == '__main__':
|
|
|
197 |
api_token = os.getenv('HF_API_TOKEN')
|
198 |
if not api_token:
|
199 |
raise ValueError("HF_API_TOKEN not found in environment variables")
|
|
|
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",info=lambda x: metaprompt_explanations.get(x, "No explanation available."))
|
112 |
refine_button = gr.Button("Refine Prompt")
|
113 |
with gr.Row():
|
114 |
gr.Markdown("### Initial prompt analysis")
|
|
|
192 |
def launch(self, share=False):
|
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=""
|
208 |
api_token = os.getenv('HF_API_TOKEN')
|
209 |
if not api_token:
|
210 |
raise ValueError("HF_API_TOKEN not found in environment variables")
|