Spaces:
Running
Running
Jeff Myers II
commited on
Commit
·
5326dc3
1
Parent(s):
3fe8091
Update space
Browse files- Gemma_Model.py +4 -2
Gemma_Model.py
CHANGED
@@ -72,10 +72,12 @@ class GemmaLLM:
|
|
72 |
return summary
|
73 |
|
74 |
def get_questions_message(self, summary, num_questions, difficulty) -> dict:
|
75 |
-
|
76 |
dict(question=str.__name__, correct_answer=str.__name__, false_answers=[str.__name__, str.__name__, str.__name__]),
|
77 |
dict(question=str.__name__, correct_answer=str.__name__, false_answers=[str.__name__, str.__name__, str.__name__]),
|
78 |
-
dict(question=str.__name__, correct_answer=str.__name__, false_answers=[str.__name__, str.__name__, str.__name__])], indent=4)
|
|
|
|
|
79 |
|
80 |
questions = f"Generate {difficulty} questions and answers from the following article:\n"
|
81 |
|
|
|
72 |
return summary
|
73 |
|
74 |
def get_questions_message(self, summary, num_questions, difficulty) -> dict:
|
75 |
+
schema = json.dumps([
|
76 |
dict(question=str.__name__, correct_answer=str.__name__, false_answers=[str.__name__, str.__name__, str.__name__]),
|
77 |
dict(question=str.__name__, correct_answer=str.__name__, false_answers=[str.__name__, str.__name__, str.__name__]),
|
78 |
+
dict(question=str.__name__, correct_answer=str.__name__, false_answers=[str.__name__, str.__name__, str.__name__])], indent=4)
|
79 |
+
|
80 |
+
question = "You are a helpful assistant. Your main task is to generate " + str(num_questions) + " multiple choice questions from an article. Respond in the following JSON structure and schema:\n\njson\n```\n" + schema + "\n```\n\nThere should only be " + str(num_questions) + " questions generated. Each question should only have 3 false answers and 1 correct answer. The correct answer should be the most relevant answer based on the context derived from the article. False answers should not contain the correct answer. False answers should contain false information but also be reasonably plausible for answering the question. ONLY RESPOND WITH RAW JSON!!!"
|
81 |
|
82 |
questions = f"Generate {difficulty} questions and answers from the following article:\n"
|
83 |
|