vs4vijay commited on
Commit
a616993
·
1 Parent(s): f90adc9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -6
app.py CHANGED
@@ -59,12 +59,38 @@ def get_image(url):
59
  def main():
60
  prompt = "Hello world, I'm vizard,"
61
 
62
- ui = gr.Interface.from_pipeline(
63
- get_text_summarizer_pipeline(),
64
- title="OneTitle",
65
- description="OneDesc",
66
- examples=['one.png', 'two.png', 'three.jpeg'],
67
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  ui.launch(enable_queue=True)
69
 
70
  # pipe = pipeline(task="image-classification", model="microsoft/dit-base-finetuned-rvlcdip")
 
59
  def main():
60
  prompt = "Hello world, I'm vizard,"
61
 
62
+ gpt2_pipe = get_gpt2_pipeline()
63
+ def greet(prompt):
64
+ return gpt2_pipe(prompt, max_length=1000, num_return_sequences=3)
65
+
66
+ with gr.Blocks() as ui:
67
+ with gr.Row():
68
+ with gr.Column():
69
+ gpt_int = gr.Interface(
70
+ fn=greet,
71
+ inputs=gr.Textbox(lines=2, placeholder="Enter some text here..."),
72
+ outputs="text",
73
+ title="GPT2",
74
+ description="OneDesc",
75
+ )
76
+ with gr.Row():
77
+ with gr.Column():
78
+ gpt_int2 = gr.Interface(
79
+ fn=greet,
80
+ inputs=gr.Textbox(lines=2, placeholder="Enter some text here..."),
81
+ outputs="text",
82
+ title="GPT2",
83
+ description="OneDesc",
84
+ )
85
+ gr.Examples(['one.png', 'two.png', 'three.jpeg'])
86
+
87
+
88
+ # ui = gr.Interface.from_pipeline(
89
+ # get_text_summarizer_pipeline(),
90
+ # title="OneTitle",
91
+ # description="OneDesc",
92
+ # examples=['one.png', 'two.png', 'three.jpeg'],
93
+ # )
94
  ui.launch(enable_queue=True)
95
 
96
  # pipe = pipeline(task="image-classification", model="microsoft/dit-base-finetuned-rvlcdip")