Spaces:
Build error
Build error
sandeepmajumdar
commited on
Commit
•
25c3227
1
Parent(s):
6bc5c91
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
def convert(
|
5 |
model = pipeline('text-generation', model='bigscience/bloom-1b1')
|
6 |
-
result = model(
|
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="
|
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 |
|