Wootang01 commited on
Commit
87c4f95
·
1 Parent(s): 8b69f55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- generator = pipeline('text-generation', model='gpt2')
5
 
6
  def generate(text):
7
  result = generator(text, max_length=30, num_return_sequences=1)
@@ -12,11 +12,7 @@ examples = [
12
  ["Zoe only recently began writing songs."],
13
  ]
14
 
15
- demo = gr.Interface(
16
- fn=generate,
17
- inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
18
- outputs=gr.outputs.Textbox(label="Generated Text"),
19
- examples=examples
20
- )
21
 
22
  demo.launch()
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ generator = pipeline('text-generation', model='huggingface/bigscience/bloomz-1b7')
5
 
6
  def generate(text):
7
  result = generator(text, max_length=30, num_return_sequences=1)
 
12
  ["Zoe only recently began writing songs."],
13
  ]
14
 
15
+ demo = gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label="Input Text"), outputs=gr.outputs.Textbox(label="Generated Text"),
16
+ examples=examples)
 
 
 
 
17
 
18
  demo.launch()