Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from model import GPT2PPL
|
| 3 |
|
| 4 |
+
# initialize the model
|
| 5 |
+
model = GPT2PPL()
|
| 6 |
|
| 7 |
+
|
| 8 |
+
def greet(sentence):
|
| 9 |
+
return model(sentence)
|
| 10 |
|
| 11 |
|
| 12 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|