Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
model_ckpt = "HenryAI/KerasBERTv1"
|
|
@@ -13,13 +14,13 @@ def cloze_task(text):
|
|
| 13 |
answer = []
|
| 14 |
description="Let's see if BERT has learnt how to write Keras!"
|
| 15 |
title="Keras BERT v1",
|
| 16 |
-
|
| 17 |
title= title, description = description,
|
| 18 |
inputs=[gr.inputs.Textbox(lines=3)],
|
| 19 |
outputs=[gr.outputs.Textbox(label="Answer"),],
|
| 20 |
examples=[["from tensorflow.keras import [MASK]"],],
|
| 21 |
enable_queue=True
|
| 22 |
)
|
| 23 |
-
|
| 24 |
|
| 25 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import torch
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
model_ckpt = "HenryAI/KerasBERTv1"
|
|
|
|
| 14 |
answer = []
|
| 15 |
description="Let's see if BERT has learnt how to write Keras!"
|
| 16 |
title="Keras BERT v1",
|
| 17 |
+
interface = gr.Interface(fn= cloze_task,
|
| 18 |
title= title, description = description,
|
| 19 |
inputs=[gr.inputs.Textbox(lines=3)],
|
| 20 |
outputs=[gr.outputs.Textbox(label="Answer"),],
|
| 21 |
examples=[["from tensorflow.keras import [MASK]"],],
|
| 22 |
enable_queue=True
|
| 23 |
)
|
| 24 |
+
interface.launch(debug=True)
|
| 25 |
|
| 26 |
|