Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,6 @@ with gr.Blocks(title="Quizmona", theme=gr.themes.Default(primary_hue="green", se
|
|
| 56 |
|
| 57 |
response = client.text_generation(
|
| 58 |
formatted_prompt, **generate_kwargs, stream=False, details=False, return_full_text=False,
|
| 59 |
-
# One question with choices and answer is on average 57 tokens
|
| 60 |
)
|
| 61 |
|
| 62 |
output_json = json.loads(f"{response}")
|
|
@@ -96,7 +95,7 @@ with gr.Blocks(title="Quizmona", theme=gr.themes.Default(primary_hue="green", se
|
|
| 96 |
|
| 97 |
check_button = gr.Button("Check Score")
|
| 98 |
|
| 99 |
-
score_textbox = gr.
|
| 100 |
|
| 101 |
@check_button.click(inputs=question_radios, outputs=score_textbox)
|
| 102 |
def compare_answers(*user_answers):
|
|
@@ -118,9 +117,13 @@ with gr.Blocks(title="Quizmona", theme=gr.themes.Default(primary_hue="green", se
|
|
| 118 |
if item in answers_list:
|
| 119 |
score += 1
|
| 120 |
|
| 121 |
-
message =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
return message
|
| 124 |
|
| 125 |
if __name__ == "__main__":
|
| 126 |
-
demo.launch(show_api=False)
|
|
|
|
| 56 |
|
| 57 |
response = client.text_generation(
|
| 58 |
formatted_prompt, **generate_kwargs, stream=False, details=False, return_full_text=False,
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
output_json = json.loads(f"{response}")
|
|
|
|
| 95 |
|
| 96 |
check_button = gr.Button("Check Score")
|
| 97 |
|
| 98 |
+
score_textbox = gr.HTML()
|
| 99 |
|
| 100 |
@check_button.click(inputs=question_radios, outputs=score_textbox)
|
| 101 |
def compare_answers(*user_answers):
|
|
|
|
| 117 |
if item in answers_list:
|
| 118 |
score += 1
|
| 119 |
|
| 120 |
+
message = """
|
| 121 |
+
<center>
|
| 122 |
+
<h2>You got {message} over 10!</h2>
|
| 123 |
+
</center>
|
| 124 |
+
"""
|
| 125 |
|
| 126 |
return message
|
| 127 |
|
| 128 |
if __name__ == "__main__":
|
| 129 |
+
demo.launch(show_api=False)
|