Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -195,8 +195,9 @@ def generate_prompt(model):
|
|
| 195 |
# cosine_scores(model, sentence)
|
| 196 |
|
| 197 |
|
| 198 |
-
def
|
| 199 |
-
|
|
|
|
| 200 |
|
| 201 |
def check_answer(guess:str):
|
| 202 |
global guesses
|
|
@@ -257,11 +258,13 @@ def main():
|
|
| 257 |
text_input = gr.Textbox()
|
| 258 |
text_output = gr.Textbox()
|
| 259 |
text_button = gr.Button("Submit")
|
|
|
|
| 260 |
with gr.Accordion("Open for previous guesses"):
|
| 261 |
text_guesses = gr.Markdown()
|
| 262 |
# with gr.Tab("Testing"):
|
| 263 |
# gr.Markdown(f"""The Embeddings are {sent_embeddings}.""")
|
| 264 |
text_button.click(check_answer, inputs=[text_input], outputs=[mark_question, text_output, text_guesses])
|
|
|
|
| 265 |
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 266 |
iface.launch()
|
| 267 |
|
|
|
|
| 195 |
# cosine_scores(model, sentence)
|
| 196 |
|
| 197 |
|
| 198 |
+
def new_prompt(name):
|
| 199 |
+
model = get_model()
|
| 200 |
+
return generate_prompt(model)
|
| 201 |
|
| 202 |
def check_answer(guess:str):
|
| 203 |
global guesses
|
|
|
|
| 258 |
text_input = gr.Textbox()
|
| 259 |
text_output = gr.Textbox()
|
| 260 |
text_button = gr.Button("Submit")
|
| 261 |
+
prompt_button = gr.Button("New Prompt")
|
| 262 |
with gr.Accordion("Open for previous guesses"):
|
| 263 |
text_guesses = gr.Markdown()
|
| 264 |
# with gr.Tab("Testing"):
|
| 265 |
# gr.Markdown(f"""The Embeddings are {sent_embeddings}.""")
|
| 266 |
text_button.click(check_answer, inputs=[text_input], outputs=[mark_question, text_output, text_guesses])
|
| 267 |
+
promt_button.click(new_prompt, inputs=[], outputs=[mark_question])
|
| 268 |
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 269 |
iface.launch()
|
| 270 |
|