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"] = Field(..., description="Choice of meta prompt strategy")
|
12 |
|
13 |
class RefinementOutput(BaseModel):
|
14 |
query_analysis: Optional[str] = None
|
@@ -34,6 +34,8 @@ class PromptRefiner:
|
|
34 |
selected_meta_prompt = metadone
|
35 |
elif prompt_input.meta_prompt_choice == "star":
|
36 |
selected_meta_prompt = echo_prompt_refiner
|
|
|
|
|
37 |
else:
|
38 |
selected_meta_prompt = advanced_meta_prompt
|
39 |
|
@@ -225,6 +227,7 @@ if __name__ == '__main__':
|
|
225 |
original_meta_prompt = os.getenv('original_meta_prompt')
|
226 |
new_meta_prompt = os.getenv('new_meta_prompt')
|
227 |
advanced_meta_prompt = os.getenv('advanced_meta_prompt')
|
|
|
228 |
|
229 |
prompt_refiner = PromptRefiner(api_token)
|
230 |
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"] = Field(..., description="Choice of meta prompt strategy")
|
12 |
|
13 |
class RefinementOutput(BaseModel):
|
14 |
query_analysis: Optional[str] = None
|
|
|
34 |
selected_meta_prompt = metadone
|
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 |
|
|
|
227 |
original_meta_prompt = os.getenv('original_meta_prompt')
|
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)
|