fittar commited on
Commit
ae3cb60
1 Parent(s): 8cf8318

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -27,6 +27,10 @@ model.to(device)
27
  tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
28
  tokenizer.pad_token = tokenizer.eos_token
29
 
 
 
 
 
30
 
31
  examples = [
32
  ["Is string theory right?"],
@@ -35,7 +39,7 @@ examples = [
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
 
27
  tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
28
  tokenizer.pad_token = tokenizer.eos_token
29
 
30
+ def generate(text):
31
+ result =generate(text,model,tokenizer,do_sample=True,device=device)
32
+ return result
33
+
34
 
35
  examples = [
36
  ["Is string theory right?"],
 
39
  ]
40
 
41
  demo = gr.Interface(
42
+ fn =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