Update app.py
Browse files
app.py
CHANGED
|
@@ -15,11 +15,18 @@ level_options = ["Beginner", "Intermediate", "Advanced"]
|
|
| 15 |
|
| 16 |
# Function: single lesson
|
| 17 |
def generate_lesson(grade, topic, level):
|
| 18 |
-
prompt = f"""Generate a Khmer math lesson plan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
Grade: {grade}
|
| 21 |
Topic: {topic}
|
| 22 |
TaRL Level: {level}"""
|
|
|
|
| 23 |
output = pipe(prompt, max_new_tokens=300, temperature=0.7, do_sample=True)
|
| 24 |
return output[0]['generated_text']
|
| 25 |
|
|
|
|
| 15 |
|
| 16 |
# Function: single lesson
|
| 17 |
def generate_lesson(grade, topic, level):
|
| 18 |
+
prompt = f"""Generate a Khmer math lesson plan with the following structure:
|
| 19 |
+
|
| 20 |
+
Lesson Title:
|
| 21 |
+
Objective:
|
| 22 |
+
Activity:
|
| 23 |
+
Instruction (Khmer):
|
| 24 |
+
Materials:
|
| 25 |
|
| 26 |
Grade: {grade}
|
| 27 |
Topic: {topic}
|
| 28 |
TaRL Level: {level}"""
|
| 29 |
+
|
| 30 |
output = pipe(prompt, max_new_tokens=300, temperature=0.7, do_sample=True)
|
| 31 |
return output[0]['generated_text']
|
| 32 |
|