File size: 583 Bytes
c92b89d
9a9a4a3
c92b89d
25c3227
9a9a4a3
25c3227
 
c92b89d
9a9a4a3
 
 
 
25c3227
9a9a4a3
 
c92b89d
9a9a4a3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline

def convert(prompt):
    model = pipeline('text-generation', model='bigscience/bloom-1b1')
    result = model(prompt, max_length=40)
    return result[0]['generated_text']

with gr.Blocks() as bls:
    gr.Markdown("Here is a Text Generation app")
    with gr.Row():
        inp = gr.Textbox(label="Type your prompt here and click Run", placeholder='Example: The main cloud services of AWS are:')
        out = gr.Textbox(label="Output")
    btn = gr.Button("Run")
    btn.click(fn=convert, inputs=inp, outputs=out)

bls.launch()