Update app.py
Browse files
app.py
CHANGED
@@ -28,10 +28,6 @@ tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
|
|
28 |
tokenizer.pad_token = tokenizer.eos_token
|
29 |
|
30 |
|
31 |
-
def vipe_generate(text):
|
32 |
-
result =generate(text,model,tokenizer,do_sample=True,device=device)
|
33 |
-
return result
|
34 |
-
|
35 |
examples = [
|
36 |
["Is string theory right?"],
|
37 |
["She felt like a flower in December"],
|
@@ -39,7 +35,7 @@ examples = [
|
|
39 |
]
|
40 |
|
41 |
demo = gr.Interface(
|
42 |
-
fn=vipe_generate,
|
43 |
inputs=gr.inputs.Textbox(lines=5, label="Arbitrary Input Text"),
|
44 |
outputs=gr.outputs.Textbox(label="Generated Prompt for Visualizations"),
|
45 |
examples=examples
|
|
|
28 |
tokenizer.pad_token = tokenizer.eos_token
|
29 |
|
30 |
|
|
|
|
|
|
|
|
|
31 |
examples = [
|
32 |
["Is string theory right?"],
|
33 |
["She felt like a flower in December"],
|
|
|
35 |
]
|
36 |
|
37 |
demo = gr.Interface(
|
38 |
+
fn =vipe_generate(text,model,tokenizer,do_sample=True,device=device),
|
39 |
inputs=gr.inputs.Textbox(lines=5, label="Arbitrary Input Text"),
|
40 |
outputs=gr.outputs.Textbox(label="Generated Prompt for Visualizations"),
|
41 |
examples=examples
|