Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from typing import Optional, Literal
|
|
9 |
|
10 |
class PromptInput(BaseModel):
|
11 |
text: str = Field(..., description="The initial prompt text")
|
12 |
-
meta_prompt_choice: Literal["superstar","star","done","physics","morphosis", "verse", "phor","bolism","math"] = Field(..., description="Choice of meta prompt strategy")
|
13 |
|
14 |
class RefinementOutput(BaseModel):
|
15 |
query_analysis: Optional[str] = None
|
@@ -39,6 +39,8 @@ class PromptRefiner:
|
|
39 |
selected_meta_prompt = advanced_echo_prompt_refiner
|
40 |
elif prompt_input.meta_prompt_choice == "math":
|
41 |
selected_meta_prompt = math_meta_prompt
|
|
|
|
|
42 |
else:
|
43 |
selected_meta_prompt = advanced_meta_prompt
|
44 |
|
@@ -123,7 +125,7 @@ class GradioInterface:
|
|
123 |
with gr.Accordion("Meta Prompt explanation", open=False):
|
124 |
gr.Markdown(explanation_markdown)
|
125 |
with gr.Row():
|
126 |
-
meta_prompt_choice = gr.Radio(["superstar", "star", "done", "physics", "morphosis", "verse", "phor","bolism","math"], label="Choose Meta Prompt", value="morphosis")
|
127 |
refine_button = gr.Button("Refine Prompt")
|
128 |
with gr.Row():
|
129 |
gr.Markdown("### Initial prompt analysis")
|
@@ -241,6 +243,7 @@ if __name__ == '__main__':
|
|
241 |
new_meta_prompt = os.getenv('new_meta_prompt')
|
242 |
advanced_meta_prompt = os.getenv('advanced_meta_prompt')
|
243 |
math_meta_prompt = os.getenv('math_meta_prompt')
|
|
|
244 |
|
245 |
|
246 |
prompt_refiner = PromptRefiner(api_key)
|
|
|
9 |
|
10 |
class PromptInput(BaseModel):
|
11 |
text: str = Field(..., description="The initial prompt text")
|
12 |
+
meta_prompt_choice: Literal["superstar","star","done","physics","morphosis", "verse", "phor","bolism","math", "math_meta"] = Field(..., description="Choice of meta prompt strategy")
|
13 |
|
14 |
class RefinementOutput(BaseModel):
|
15 |
query_analysis: Optional[str] = None
|
|
|
39 |
selected_meta_prompt = advanced_echo_prompt_refiner
|
40 |
elif prompt_input.meta_prompt_choice == "math":
|
41 |
selected_meta_prompt = math_meta_prompt
|
42 |
+
elif prompt_input.meta_prompt_choice == "math_meta":
|
43 |
+
selected_meta_prompt = math_meta
|
44 |
else:
|
45 |
selected_meta_prompt = advanced_meta_prompt
|
46 |
|
|
|
125 |
with gr.Accordion("Meta Prompt explanation", open=False):
|
126 |
gr.Markdown(explanation_markdown)
|
127 |
with gr.Row():
|
128 |
+
meta_prompt_choice = gr.Radio(["superstar", "star", "done", "physics", "morphosis", "verse", "phor","bolism","math","math_meta"], label="Choose Meta Prompt", value="morphosis")
|
129 |
refine_button = gr.Button("Refine Prompt")
|
130 |
with gr.Row():
|
131 |
gr.Markdown("### Initial prompt analysis")
|
|
|
243 |
new_meta_prompt = os.getenv('new_meta_prompt')
|
244 |
advanced_meta_prompt = os.getenv('advanced_meta_prompt')
|
245 |
math_meta_prompt = os.getenv('math_meta_prompt')
|
246 |
+
math_meta = os.getenv('math_meta')
|
247 |
|
248 |
|
249 |
prompt_refiner = PromptRefiner(api_key)
|