Spaces:
Runtime error
Runtime error
Farsi, Ali
commited on
Commit
β’
83c002a
1
Parent(s):
ec8a922
dev
Browse files
app.py
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(name):
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs=
|
7 |
-
iface.launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoTokenizer
|
3 |
+
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
|
5 |
+
|
6 |
+
sequence = "In a hole in the ground there lived a hobbit."
|
7 |
+
res = tokenizer(sequence)
|
8 |
|
9 |
def greet(name):
|
10 |
return "Hello " + name + "!!"
|
11 |
|
12 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs=res)
|
13 |
+
iface.launch()
|
14 |
+
|