Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,12 +110,15 @@ if submit_button:
|
|
| 110 |
st.markdown(f"**Interviewee:** {answer}")
|
| 111 |
st.session_state.messages.append({"role": "user", "content": f"Interviewee: {answer}"})
|
| 112 |
|
| 113 |
-
# Judge evaluates
|
| 114 |
feedback_prompt = f"""Evaluate this interview exchange:
|
| 115 |
Question: {question}
|
| 116 |
Answer: {answer}
|
| 117 |
Provide specific feedback and a score from 1-10 (10=best).
|
| 118 |
-
Format
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
judge_response = call_llama(feedback_prompt).strip()
|
| 121 |
|
|
@@ -123,8 +126,9 @@ if submit_button:
|
|
| 123 |
score = 5 # default
|
| 124 |
if "Score:" in judge_response:
|
| 125 |
try:
|
| 126 |
-
|
| 127 |
-
|
|
|
|
| 128 |
pass
|
| 129 |
|
| 130 |
# Store data
|
|
|
|
| 110 |
st.markdown(f"**Interviewee:** {answer}")
|
| 111 |
st.session_state.messages.append({"role": "user", "content": f"Interviewee: {answer}"})
|
| 112 |
|
| 113 |
+
# Judge evaluates - FIXED STRING FORMATTING HERE
|
| 114 |
feedback_prompt = f"""Evaluate this interview exchange:
|
| 115 |
Question: {question}
|
| 116 |
Answer: {answer}
|
| 117 |
Provide specific feedback and a score from 1-10 (10=best).
|
| 118 |
+
Format your response as:
|
| 119 |
+
"Feedback: [your feedback here]
|
| 120 |
+
Score: [number between 1-10]"
|
| 121 |
+
"""
|
| 122 |
|
| 123 |
judge_response = call_llama(feedback_prompt).strip()
|
| 124 |
|
|
|
|
| 126 |
score = 5 # default
|
| 127 |
if "Score:" in judge_response:
|
| 128 |
try:
|
| 129 |
+
score_part = judge_response.split("Score:")[1].strip()
|
| 130 |
+
score = int(score_part.split()[0])
|
| 131 |
+
except (ValueError, IndexError):
|
| 132 |
pass
|
| 133 |
|
| 134 |
# Store data
|