sandeepmajumdar commited on
Commit
25c3227
1 Parent(s): 6bc5c91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,16 +1,16 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- def convert(Sentence):
5
  model = pipeline('text-generation', model='bigscience/bloom-1b1')
6
- result = model(Sentence)
7
- return result[0]
8
 
9
  with gr.Blocks() as bls:
10
  gr.Markdown("Here is a Text Generation app")
11
  with gr.Row():
12
  inp = gr.Textbox(label="Type your prompt here and click Run", placeholder='Example: The main cloud services of AWS are:')
13
- out = gr.Textbox(label="The sentiment is:")
14
  btn = gr.Button("Run")
15
  btn.click(fn=convert, inputs=inp, outputs=out)
16
 
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ def convert(prompt):
5
  model = pipeline('text-generation', model='bigscience/bloom-1b1')
6
+ result = model(prompt, max_length=40)
7
+ return result[0]['generated_text']
8
 
9
  with gr.Blocks() as bls:
10
  gr.Markdown("Here is a Text Generation app")
11
  with gr.Row():
12
  inp = gr.Textbox(label="Type your prompt here and click Run", placeholder='Example: The main cloud services of AWS are:')
13
+ out = gr.Textbox(label="Output")
14
  btn = gr.Button("Run")
15
  btn.click(fn=convert, inputs=inp, outputs=out)
16