File size: 914 Bytes
65c5bd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7ebc140
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from gradio.inputs import Textbox

io = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")

def generate_text(c1, c2, area=None):
    if not(area.strip()):
        prompt = "{} is joining {}. By aquiring {}, a startup, {} will".format(c2, c1, c2, c1)
    else:
        prompt = "{} is joining {}. By aquiring {}, a {} startup, {} will".format(c2, c1, c2, area, c1)
    
    return io(prompt)

examples = [
    ["Hugging Face", "Gradio", "machine learning"],
    ["Microsoft", "GitHub", "hosting for version control"]
]

gr.Interface(generate_text, [Textbox(label="Acquiring company"), Textbox(label="Startup"), Textbox(label="Type of startup (optional)")], "textbox", examples=examples, description="Acquisition Post Generator: provide the names of any 2 companies, and a state-of-the-art machine learning language model (GPT-J) will write about their acquisition.", theme="default").launch()