Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from typing import Optional, Literal
|
|
8 |
|
9 |
class PromptInput(BaseModel):
|
10 |
text: str = Field(..., description="The initial prompt text")
|
11 |
-
meta_prompt_choice: Literal["star","done","physics","morphosis", "verse", "phor","bolism","math"] = Field(..., description="Choice of meta prompt strategy")
|
12 |
|
13 |
class RefinementOutput(BaseModel):
|
14 |
query_analysis: Optional[str] = None
|
@@ -35,7 +35,9 @@ class PromptRefiner:
|
|
35 |
elif prompt_input.meta_prompt_choice == "star":
|
36 |
selected_meta_prompt = echo_prompt_refiner
|
37 |
elif prompt_input.meta_prompt_choice == "math":
|
38 |
-
selected_meta_prompt = math_meta_prompt
|
|
|
|
|
39 |
else:
|
40 |
selected_meta_prompt = advanced_meta_prompt
|
41 |
|
@@ -113,7 +115,7 @@ class GradioInterface:
|
|
113 |
with gr.Accordion("Meta Prompt explanation", open=False):
|
114 |
gr.Markdown(explanation_markdown)
|
115 |
with gr.Row():
|
116 |
-
meta_prompt_choice = gr.Radio(["star","done","physics","morphosis", "verse", "phor","bolism","math"], label="Choose Meta Prompt", value="star")
|
117 |
refine_button = gr.Button("Refine Prompt")
|
118 |
with gr.Row():
|
119 |
gr.Markdown("### Initial prompt analysis")
|
@@ -228,6 +230,8 @@ if __name__ == '__main__':
|
|
228 |
new_meta_prompt = os.getenv('new_meta_prompt')
|
229 |
advanced_meta_prompt = os.getenv('advanced_meta_prompt')
|
230 |
math_meta_prompt = os.getenv('metamath')
|
|
|
|
|
231 |
|
232 |
prompt_refiner = PromptRefiner(api_token)
|
233 |
gradio_interface = GradioInterface(prompt_refiner)
|
|
|
8 |
|
9 |
class PromptInput(BaseModel):
|
10 |
text: str = Field(..., description="The initial prompt text")
|
11 |
+
meta_prompt_choice: Literal["star","done","physics","morphosis", "verse", "phor","bolism","math","arpe"] = Field(..., description="Choice of meta prompt strategy")
|
12 |
|
13 |
class RefinementOutput(BaseModel):
|
14 |
query_analysis: Optional[str] = None
|
|
|
35 |
elif prompt_input.meta_prompt_choice == "star":
|
36 |
selected_meta_prompt = echo_prompt_refiner
|
37 |
elif prompt_input.meta_prompt_choice == "math":
|
38 |
+
selected_meta_prompt = math_meta_prompt
|
39 |
+
elif prompt_input.meta_prompt_choice == "arpe":
|
40 |
+
selected_meta_prompt = autoregressive_metaprompt
|
41 |
else:
|
42 |
selected_meta_prompt = advanced_meta_prompt
|
43 |
|
|
|
115 |
with gr.Accordion("Meta Prompt explanation", open=False):
|
116 |
gr.Markdown(explanation_markdown)
|
117 |
with gr.Row():
|
118 |
+
meta_prompt_choice = gr.Radio(["star","done","physics","morphosis", "verse", "phor","bolism","math","arpe"], label="Choose Meta Prompt", value="star")
|
119 |
refine_button = gr.Button("Refine Prompt")
|
120 |
with gr.Row():
|
121 |
gr.Markdown("### Initial prompt analysis")
|
|
|
230 |
new_meta_prompt = os.getenv('new_meta_prompt')
|
231 |
advanced_meta_prompt = os.getenv('advanced_meta_prompt')
|
232 |
math_meta_prompt = os.getenv('metamath')
|
233 |
+
autoregressive_metaprompt = os.getenv('autoregressive_metaprompt')
|
234 |
+
|
235 |
|
236 |
prompt_refiner = PromptRefiner(api_token)
|
237 |
gradio_interface = GradioInterface(prompt_refiner)
|