Wootang01 commited on
Commit
97138d8
1 Parent(s): 193579c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -6,18 +6,19 @@ import torch
6
  from transformers import pipeline
7
 
8
  #instantiate variables as strings
9
- #title="Text Generators"
10
  #title1="Level 1 Text Generator"
11
  #title2="Level 3 Text Generator"
 
12
  #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."
13
  #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."
14
  #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."
15
- #examples = [
16
- # ["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
17
- # ["What is this life for?"],
18
- # ["Write a short story."],
19
- # ["Once upon a time, "]
20
- #]
21
 
22
  #instantiate variables as functions
23
  #pipe = pipeline("text-generation", model='EleutherAI/gpt-neo-2.7B', trust_remote_code=True)
@@ -60,5 +61,5 @@ def answer(query):
60
  # demo1.launch(debug=True)
61
  #gr.Interface.from_pipeline(pipe).launch()
62
 
63
- Demo = gr.Interface(fn=answer,inputs='text',outputs='text',examples=[['What is the capital of India ?']])
64
  Demo.launch()
 
6
  from transformers import pipeline
7
 
8
  #instantiate variables as strings
9
+ title="Text Generator"
10
  #title1="Level 1 Text Generator"
11
  #title2="Level 3 Text Generator"
12
+ description="This text generator has been trained to chat and to respond to natural language instructions."
13
  #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."
14
  #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."
15
  #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."
16
+ examples = [
17
+ ["What is the capital of China?"],
18
+ ["How do I apply for an Australian visa?"],
19
+ ["Write a short story."],
20
+ ["Once upon a time, "]
21
+ ]
22
 
23
  #instantiate variables as functions
24
  #pipe = pipeline("text-generation", model='EleutherAI/gpt-neo-2.7B', trust_remote_code=True)
 
61
  # demo1.launch(debug=True)
62
  #gr.Interface.from_pipeline(pipe).launch()
63
 
64
+ Demo = gr.Interface(fn=answer,inputs='text',outputs='text', title=title, examples=examples)
65
  Demo.launch()