Spaces:
Runtime error
Runtime error
Luis Oala
commited on
Commit
·
bbdc525
1
Parent(s):
8d37a05
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
#TODO:
|
2 |
-
#TODO:
|
3 |
import gradio as gr
|
4 |
from gradio import mix
|
5 |
from transformers import pipeline, set_seed
|
@@ -18,7 +18,7 @@ io2 = gr.Interface.load("huggingface/gpt2-large")
|
|
18 |
|
19 |
#io4 = gr.Interface.load("huggingface/gpt2-xl")
|
20 |
|
21 |
-
def inference(text,
|
22 |
"""
|
23 |
if model == "gpt2-large":
|
24 |
outtext = io2(text)
|
@@ -38,7 +38,7 @@ def inference(text, random_seed):
|
|
38 |
|
39 |
gr.Interface(
|
40 |
inference,
|
41 |
-
[gr.inputs.Textbox(label="input", placeholder="trustworthy artificial intelligence"), gr.inputs.Number(label="
|
42 |
#,gr.inputs.Dropdown(choices=["distilgpt2","gpt2-medium","gpt2-large","gpt2-xl"], type="value", default="gpt2-medium", label="model")],
|
43 |
gr.outputs.Textbox(label="gpt-2 proposal"),
|
44 |
#title=title,
|
|
|
1 |
+
#TODO: verify seed works
|
2 |
+
#TODO: integrate into markdown
|
3 |
import gradio as gr
|
4 |
from gradio import mix
|
5 |
from transformers import pipeline, set_seed
|
|
|
18 |
|
19 |
#io4 = gr.Interface.load("huggingface/gpt2-xl")
|
20 |
|
21 |
+
def inference(text, seed):
|
22 |
"""
|
23 |
if model == "gpt2-large":
|
24 |
outtext = io2(text)
|
|
|
38 |
|
39 |
gr.Interface(
|
40 |
inference,
|
41 |
+
[gr.inputs.Textbox(label="input", placeholder="trustworthy artificial intelligence"), gr.inputs.Number(label="seed")],
|
42 |
#,gr.inputs.Dropdown(choices=["distilgpt2","gpt2-medium","gpt2-large","gpt2-xl"], type="value", default="gpt2-medium", label="model")],
|
43 |
gr.outputs.Textbox(label="gpt-2 proposal"),
|
44 |
#title=title,
|