Spaces:
Runtime error
Runtime error
Commit
·
1334a88
1
Parent(s):
a43ff95
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
import json
|
|
|
|
|
|
|
3 |
|
4 |
-
|
5 |
-
|
|
|
6 |
iface = gr.Interface(fn=green, inputs=gr.inputs.Textbox(lines=2, placeholder="Put prompt here"), outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import json
|
3 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead
|
4 |
+
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
6 |
|
7 |
+
model = AutoModelWithLMHead.from_pretrained("gpt2")
|
8 |
+
def green(prompt):
|
9 |
+
print(tokenizer("help"))
|
10 |
iface = gr.Interface(fn=green, inputs=gr.inputs.Textbox(lines=2, placeholder="Put prompt here"), outputs="text")
|
11 |
iface.launch()
|