Wootang01 commited on
Commit
f74a9dd
·
1 Parent(s): cb362de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -4,6 +4,8 @@ from gradio.mix import Parallel
4
 
5
  #instantiate variables as strings
6
  title="Text Generators"
 
 
7
  description1="This is the basic text generator all students were taught to code using an older, smaller language model. Input text, submit, and the text generator will generate one output text instance."
8
  description2="This is a more advanced text generator that many students were taught to code. Input text and the text generator generates three output text instances from three language models. Importantly, two of these language models were designed to process explicit instructions."
9
  description3="This is the most advanced text generator that a few students were taught to code. Input text and the text generator generates an output text instance. You can resubmit to include that new text as input text."
@@ -11,14 +13,15 @@ examples = [
11
  ["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
12
  ["What is this life for?"],
13
  ["Write a short story."],
14
- ["What is a synonym for criticize?"]
 
15
  ]
16
 
17
  #instantiate variables as functions
18
- model1 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
19
  model2 = gr.Interface.load("huggingface/google/flan-t5-xl")
20
  model3 = gr.Interface.load("huggingface/bigscience/bloomz-560m")
21
- model4 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
22
 
23
  #togethercomputer/GPT-NeoXT-Chat-Base-20B
24
  #decapoda-research/llama-7b-hf
@@ -35,8 +38,8 @@ with gr.Blocks() as demo:
35
 
36
  btn.click(complete_with_gpt, textbox, textbox)
37
 
38
- tab1 = gr.Interface.load("huggingface/gpt2", description=description1)
39
- tab2 = gr.Parallel(model1, model2, model3, inputs=gr.Textbox(lines=5, label="Input explicit or implicit instructions"), description=description2, examples=examples)
40
  tab3 = demo
41
 
42
  demo1 = gr.TabbedInterface([tab1, tab2, tab3], ["Level 1", "Level 3", "Level 5"], title=title)
 
4
 
5
  #instantiate variables as strings
6
  title="Text Generators"
7
+ title1="Level 1 Text Generator"
8
+ title2="Level 3 Text Generator"
9
  description1="This is the basic text generator all students were taught to code using an older, smaller language model. Input text, submit, and the text generator will generate one output text instance."
10
  description2="This is a more advanced text generator that many students were taught to code. Input text and the text generator generates three output text instances from three language models. Importantly, two of these language models were designed to process explicit instructions."
11
  description3="This is the most advanced text generator that a few students were taught to code. Input text and the text generator generates an output text instance. You can resubmit to include that new text as input text."
 
13
  ["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
14
  ["What is this life for?"],
15
  ["Write a short story."],
16
+ ["What is a synonym for criticize?"],
17
+ ["Once upon a time, "]
18
  ]
19
 
20
  #instantiate variables as functions
21
+ model1 = gr.Interface.load("huggingface/togethercomputer/GPT-NeoXT-Chat-Base-20B")
22
  model2 = gr.Interface.load("huggingface/google/flan-t5-xl")
23
  model3 = gr.Interface.load("huggingface/bigscience/bloomz-560m")
24
+ model4 = gr.Interface.load("huggingface/bigscience/bloom")
25
 
26
  #togethercomputer/GPT-NeoXT-Chat-Base-20B
27
  #decapoda-research/llama-7b-hf
 
38
 
39
  btn.click(complete_with_gpt, textbox, textbox)
40
 
41
+ tab1 = gr.Interface.load("huggingface/gpt2", title=title1, description=description1, examples=examples)
42
+ tab2 = gr.Parallel(model1, model2, model3, inputs=gr.Textbox(lines=5, label="Input explicit or implicit instructions"), title=title2, description=description2, examples=examples)
43
  tab3 = demo
44
 
45
  demo1 = gr.TabbedInterface([tab1, tab2, tab3], ["Level 1", "Level 3", "Level 5"], title=title)