Abubakar Abid commited on
Commit
65c5bd1
·
1 Parent(s): ecf2c02

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio.inputs import Textbox
3
+
4
+ io = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
5
+
6
+ def generate_text(c1, c2, area=None):
7
+ if not(area.strip()):
8
+ prompt = "{} is joining {}. By aquiring {}, a startup, {} will".format(c2, c1, c2, c1)
9
+ else:
10
+ prompt = "{} is joining {}. By aquiring {}, a {} startup, {} will".format(c2, c1, c2, area, c1)
11
+
12
+ return io(prompt)
13
+
14
+ examples = [
15
+ ["Hugging Face", "Gradio", "machine learning"],
16
+ ["Microsoft", "GitHub", "hosting for version control"]
17
+ ]
18
+
19
+ gr.Interface(generate_text, [Textbox(label="Acquiring company"), Textbox(label="Startup"), Textbox(label="Type of startup (optional)")], "textbox", examples=examples, description="Provide the names of any 2 companies, and a state-of-the-art machine learning language model (GPT-J) will write about their acquisition.").launch()