Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,9 +81,7 @@ You are an expert interviewer evaluating a candidate's introduction. Assess the
|
|
| 81 |
- Confidence & Professionalism
|
| 82 |
- Relevance & Structure
|
| 83 |
- Conciseness
|
| 84 |
-
|
| 85 |
Provide an evaluation summary with a score out of 10.
|
| 86 |
-
|
| 87 |
Candidate Introduction:
|
| 88 |
{answer_text}
|
| 89 |
"""
|
|
@@ -95,9 +93,7 @@ You are an expert interviewer evaluating a candidate's project explanation. Asse
|
|
| 95 |
- Problem-Solving & Impact
|
| 96 |
- Use of Examples
|
| 97 |
- Logical Flow & Structure
|
| 98 |
-
|
| 99 |
Provide an evaluation summary with a score out of 10.
|
| 100 |
-
|
| 101 |
Candidate Project Explanation:
|
| 102 |
{answer_text}
|
| 103 |
"""
|
|
@@ -126,7 +122,6 @@ def generate_improvement_suggestions():
|
|
| 126 |
prompt = f"""
|
| 127 |
You are an interview coach. Based on these Q&A:
|
| 128 |
{full_qa_context}
|
| 129 |
-
|
| 130 |
Provide detailed improvement suggestions for each answer. Be constructive and supportive.
|
| 131 |
"""
|
| 132 |
try:
|
|
@@ -212,7 +207,8 @@ if st.session_state.get("show_intro"):
|
|
| 212 |
# Evaluate all answers
|
| 213 |
if not st.session_state["evaluations"]:
|
| 214 |
for ans in st.session_state["answers"]:
|
| 215 |
-
|
|
|
|
| 216 |
|
| 217 |
st.subheader("📊 Mock Interview Completed")
|
| 218 |
total_score = sum([ev["score"] for ev in st.session_state["evaluations"]])
|
|
@@ -221,9 +217,10 @@ if st.session_state.get("show_intro"):
|
|
| 221 |
st.progress(overall_score / 10)
|
| 222 |
|
| 223 |
# Show answers & feedback
|
| 224 |
-
for i,
|
| 225 |
-
st.
|
| 226 |
-
st.write(f"**
|
|
|
|
| 227 |
st.write(f"**Score:** {ev['score']}/10")
|
| 228 |
st.write(ev["feedback"])
|
| 229 |
st.write("---")
|
|
@@ -240,7 +237,8 @@ if st.session_state.get("show_intro"):
|
|
| 240 |
def prepare_summary():
|
| 241 |
text = "# GrillMaster Candidate Intro Summary\n\n"
|
| 242 |
for i, ans in enumerate(st.session_state["answers"]):
|
| 243 |
-
|
|
|
|
| 244 |
if st.session_state.get("improvement_suggestions_generated"):
|
| 245 |
text += "## Improvement Suggestions:\n" + st.session_state["improvement_suggestions"]
|
| 246 |
return text.encode("utf-8")
|
|
|
|
| 81 |
- Confidence & Professionalism
|
| 82 |
- Relevance & Structure
|
| 83 |
- Conciseness
|
|
|
|
| 84 |
Provide an evaluation summary with a score out of 10.
|
|
|
|
| 85 |
Candidate Introduction:
|
| 86 |
{answer_text}
|
| 87 |
"""
|
|
|
|
| 93 |
- Problem-Solving & Impact
|
| 94 |
- Use of Examples
|
| 95 |
- Logical Flow & Structure
|
|
|
|
| 96 |
Provide an evaluation summary with a score out of 10.
|
|
|
|
| 97 |
Candidate Project Explanation:
|
| 98 |
{answer_text}
|
| 99 |
"""
|
|
|
|
| 122 |
prompt = f"""
|
| 123 |
You are an interview coach. Based on these Q&A:
|
| 124 |
{full_qa_context}
|
|
|
|
| 125 |
Provide detailed improvement suggestions for each answer. Be constructive and supportive.
|
| 126 |
"""
|
| 127 |
try:
|
|
|
|
| 207 |
# Evaluate all answers
|
| 208 |
if not st.session_state["evaluations"]:
|
| 209 |
for ans in st.session_state["answers"]:
|
| 210 |
+
ev = evaluate_answer(ans["question"], ans["response"], ans["type"])
|
| 211 |
+
st.session_state["evaluations"].append(ev)
|
| 212 |
|
| 213 |
st.subheader("📊 Mock Interview Completed")
|
| 214 |
total_score = sum([ev["score"] for ev in st.session_state["evaluations"]])
|
|
|
|
| 217 |
st.progress(overall_score / 10)
|
| 218 |
|
| 219 |
# Show answers & feedback
|
| 220 |
+
for i, ans in enumerate(st.session_state["answers"]):
|
| 221 |
+
ev = st.session_state["evaluations"][i]
|
| 222 |
+
st.write(f"**Q{i+1}: {ans['question']}**")
|
| 223 |
+
st.write(f"**A:** {ans['response']}")
|
| 224 |
st.write(f"**Score:** {ev['score']}/10")
|
| 225 |
st.write(ev["feedback"])
|
| 226 |
st.write("---")
|
|
|
|
| 237 |
def prepare_summary():
|
| 238 |
text = "# GrillMaster Candidate Intro Summary\n\n"
|
| 239 |
for i, ans in enumerate(st.session_state["answers"]):
|
| 240 |
+
ev = st.session_state["evaluations"][i]
|
| 241 |
+
text += f"**Q{i+1}: {ans['question']}**\n**A:** {ans['response']}\n**Score:** {ev['score']}/10\n\n"
|
| 242 |
if st.session_state.get("improvement_suggestions_generated"):
|
| 243 |
text += "## Improvement Suggestions:\n" + st.session_state["improvement_suggestions"]
|
| 244 |
return text.encode("utf-8")
|