Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -99,7 +99,7 @@ class PromptRefiner:
|
|
99 |
json_output = json.loads(json_output)
|
100 |
output={
|
101 |
key: value.replace('\\"', '"') if isinstance(value, str) else value
|
102 |
-
for key, value in json_output.items()
|
103 |
}
|
104 |
output['response_content']=json_output
|
105 |
# Clean up JSON values
|
@@ -120,7 +120,8 @@ class PromptRefiner:
|
|
120 |
return {
|
121 |
"initial_prompt_evaluation": "Error parsing response",
|
122 |
"refined_prompt": "",
|
123 |
-
"explanation_of_refinements": str(e)
|
|
|
124 |
}
|
125 |
|
126 |
def apply_prompt(self, prompt: str, model: str) -> str:
|
|
|
99 |
json_output = json.loads(json_output)
|
100 |
output={
|
101 |
key: value.replace('\\"', '"') if isinstance(value, str) else value
|
102 |
+
for key, value in json_output.items()
|
103 |
}
|
104 |
output['response_content']=json_output
|
105 |
# Clean up JSON values
|
|
|
120 |
return {
|
121 |
"initial_prompt_evaluation": "Error parsing response",
|
122 |
"refined_prompt": "",
|
123 |
+
"explanation_of_refinements": str(e),
|
124 |
+
'response_content':str(e)
|
125 |
}
|
126 |
|
127 |
def apply_prompt(self, prompt: str, model: str) -> str:
|