Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,20 +43,16 @@ def get_evaluation_questions():
|
|
| 43 |
Both lists must be of equal length.
|
| 44 |
"""
|
| 45 |
questions_str = os.environ.get("TEST_QUESTION_1")
|
| 46 |
-
print("questions", questions_str)
|
| 47 |
expected_str = os.environ.get("TEST_EXPECTED_1")
|
| 48 |
-
print("expected", expected_str)
|
| 49 |
if not questions_str or not expected_str:
|
| 50 |
return []
|
| 51 |
try:
|
| 52 |
questions_list = json.loads(questions_str)
|
| 53 |
-
print("questions lst ", questions_list)
|
| 54 |
except Exception as e:
|
| 55 |
print(f"Error parsing questions: {str(e)}")
|
| 56 |
return []
|
| 57 |
try:
|
| 58 |
expected_list = json.loads(expected_str)
|
| 59 |
-
print("expected lst", expected_list)
|
| 60 |
except Exception as e:
|
| 61 |
print(f"Error parsing expected answers: {str(e)}")
|
| 62 |
return []
|
|
@@ -143,7 +139,6 @@ def submit_prompt(email, name, system_prompt):
|
|
| 143 |
]
|
| 144 |
)
|
| 145 |
answer = response.choices[0].message.content.strip()
|
| 146 |
-
print("LLM answer:", answer)
|
| 147 |
except Exception as e:
|
| 148 |
answer = f"Error during OpenAI API call: {str(e)}"
|
| 149 |
|
|
@@ -222,8 +217,6 @@ def submit_prompt(email, name, system_prompt):
|
|
| 222 |
|
| 223 |
return (
|
| 224 |
f"Thank you for your submission, {name}!\n\n"
|
| 225 |
-
f"Your evaluation score is {score} out of {len(EVALUATION_QUESTIONS)}.\n\n"
|
| 226 |
-
f"Details:\n{result_details}"
|
| 227 |
)
|
| 228 |
|
| 229 |
def build_interface():
|
|
|
|
| 43 |
Both lists must be of equal length.
|
| 44 |
"""
|
| 45 |
questions_str = os.environ.get("TEST_QUESTION_1")
|
|
|
|
| 46 |
expected_str = os.environ.get("TEST_EXPECTED_1")
|
|
|
|
| 47 |
if not questions_str or not expected_str:
|
| 48 |
return []
|
| 49 |
try:
|
| 50 |
questions_list = json.loads(questions_str)
|
|
|
|
| 51 |
except Exception as e:
|
| 52 |
print(f"Error parsing questions: {str(e)}")
|
| 53 |
return []
|
| 54 |
try:
|
| 55 |
expected_list = json.loads(expected_str)
|
|
|
|
| 56 |
except Exception as e:
|
| 57 |
print(f"Error parsing expected answers: {str(e)}")
|
| 58 |
return []
|
|
|
|
| 139 |
]
|
| 140 |
)
|
| 141 |
answer = response.choices[0].message.content.strip()
|
|
|
|
| 142 |
except Exception as e:
|
| 143 |
answer = f"Error during OpenAI API call: {str(e)}"
|
| 144 |
|
|
|
|
| 217 |
|
| 218 |
return (
|
| 219 |
f"Thank you for your submission, {name}!\n\n"
|
|
|
|
|
|
|
| 220 |
)
|
| 221 |
|
| 222 |
def build_interface():
|