Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -180,8 +180,8 @@ def bot(history, cross_encoder):
|
|
| 180 |
yield history, prompt_html
|
| 181 |
#store_message(db,history[-1][0],history[-1][1],cross_encoder)
|
| 182 |
|
| 183 |
-
def system_instructions(question_difficulty, topic,
|
| 184 |
-
return f"""<s> [INST] Your are a great teacher and your task is to create 10 questions with 4 choices with a {question_difficulty} difficulty about topic request " {topic} " only from the below given documents, {
|
| 185 |
|
| 186 |
|
| 187 |
#with gr.Blocks(theme='Insuz/SimpleIndigo') as demo:
|
|
@@ -319,7 +319,7 @@ with gr.Blocks(title="Quiz Maker", theme=gr.themes.Default(primary_hue="green",
|
|
| 319 |
document_summaries = [f"[DOCUMENT {i+1}]: {summary}" for i, summary in enumerate(documents)]
|
| 320 |
documents_str='\n'.join(document_summaries)
|
| 321 |
formatted_prompt = system_instructions(
|
| 322 |
-
question_difficulty, topic,
|
| 323 |
print(formatted_prompt)
|
| 324 |
pre_prompt = [
|
| 325 |
{"role": "system", "content": formatted_prompt}
|
|
|
|
| 180 |
yield history, prompt_html
|
| 181 |
#store_message(db,history[-1][0],history[-1][1],cross_encoder)
|
| 182 |
|
| 183 |
+
def system_instructions(question_difficulty, topic,documents_str):
|
| 184 |
+
return f"""<s> [INST] Your are a great teacher and your task is to create 10 questions with 4 choices with a {question_difficulty} difficulty about topic request " {topic} " only from the below given documents, {documents_str} then create an answers. Index in JSON format, the questions as "Q#":"" to "Q#":"", the four choices as "Q#:C1":"" to "Q#:C4":"", and the answers as "A#":"Q#:C#" to "A#":"Q#:C#". [/INST]"""
|
| 185 |
|
| 186 |
|
| 187 |
#with gr.Blocks(theme='Insuz/SimpleIndigo') as demo:
|
|
|
|
| 319 |
document_summaries = [f"[DOCUMENT {i+1}]: {summary}" for i, summary in enumerate(documents)]
|
| 320 |
documents_str='\n'.join(document_summaries)
|
| 321 |
formatted_prompt = system_instructions(
|
| 322 |
+
question_difficulty, topic,documents_str)
|
| 323 |
print(formatted_prompt)
|
| 324 |
pre_prompt = [
|
| 325 |
{"role": "system", "content": formatted_prompt}
|