Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,53 +20,48 @@ genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
|
| 20 |
GRID_ROWS, GRID_COLS = 20, 14
|
| 21 |
|
| 22 |
# ---------------- PROMPTS ----------------
|
| 23 |
-
PROMPTS = {
|
| 24 |
-
|
| 25 |
-
"
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
(repeat the Question block for all questions, in order)
|
| 63 |
-
==== QUESTIONS END ====
|
| 64 |
-
|
| 65 |
-
==== MARKSCHEME BEGIN ====
|
| 66 |
-
<verbatim markscheme text exactly as in PDF; include mark IDs and use brackets for M/A/R notations where they appear>
|
| 67 |
-
==== MARKSCHEME END ====
|
| 68 |
"""
|
| 69 |
-
|
|
|
|
| 70 |
|
| 71 |
# GRADING_PROMPT unchanged except we will print steps around calling it
|
| 72 |
"GRADING_PROMPT": {
|
|
|
|
| 20 |
GRID_ROWS, GRID_COLS = 20, 14
|
| 21 |
|
| 22 |
# ---------------- PROMPTS ----------------
|
| 23 |
+
PROMPTS["QP_MS_TRANSCRIPTION"] = {
|
| 24 |
+
"role": "system",
|
| 25 |
+
"content": """You are a high-quality OCR/Transcription assistant.
|
| 26 |
+
|
| 27 |
+
INPUT: This file is a PDF that first contains the Question Paper and immediately after it the Markscheme.
|
| 28 |
+
|
| 29 |
+
TASK:
|
| 30 |
+
1. Transcribe EXACTLY all the questions FIRST (with their total marks).
|
| 31 |
+
2. After ALL questions, transcribe the Markscheme exactly, preserving M/A/R notation in brackets.
|
| 32 |
+
3. Always number the questions sequentially (Question 1, Question 2, Question 3, …) **in the order they appear in the PDF**, even if the PDF shows a different number or leaves it blank. Do NOT skip or leave Question: blank.
|
| 33 |
+
|
| 34 |
+
FORMAT:
|
| 35 |
+
==== PAPER TOTAL MARKS ====
|
| 36 |
+
<total marks>
|
| 37 |
+
|
| 38 |
+
==== QUESTIONS BEGIN ====
|
| 39 |
+
Question 1
|
| 40 |
+
Total Marks: <number>
|
| 41 |
+
QP: <question text>
|
| 42 |
+
--QUESTION-END--
|
| 43 |
+
|
| 44 |
+
Question 2
|
| 45 |
+
Total Marks: <number>
|
| 46 |
+
QP: <question text>
|
| 47 |
+
--QUESTION-END--
|
| 48 |
+
|
| 49 |
+
(repeat for all questions in order of appearance)
|
| 50 |
+
|
| 51 |
+
==== QUESTIONS END ====
|
| 52 |
+
|
| 53 |
+
==== MARKSCHEME BEGIN ====
|
| 54 |
+
Answer 1:
|
| 55 |
+
<exact MS for Q1 with notations M1, A1, R1 etc>
|
| 56 |
+
|
| 57 |
+
Answer 2:
|
| 58 |
+
<exact MS for Q2 with notations>
|
| 59 |
+
|
| 60 |
+
(repeat for all answers)
|
| 61 |
+
==== MARKSCHEME END ====
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
"""
|
| 63 |
+
}
|
| 64 |
+
,
|
| 65 |
|
| 66 |
# GRADING_PROMPT unchanged except we will print steps around calling it
|
| 67 |
"GRADING_PROMPT": {
|