awacke1 commited on
Commit
bfe5356
1 Parent(s): 003bd87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -4,8 +4,7 @@ import requests
4
  # GPT-J-6B API
5
  API_URL = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6B"
6
  headers = {"Authorization": "Bearer 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"}
7
- prompt = """
8
- Tweet: I hate it when my phone battery dies.
9
  Sentiment: Negative
10
  ###
11
  Tweet: My day has been 👍
@@ -15,8 +14,7 @@ Tweet: This is the link to the article
15
  Sentiment: Neutral
16
  ###
17
  Tweet: This new music video was incredibile
18
- Sentiment:
19
- """
20
 
21
  examples = [["river"], ["night"], ["trees"],["table"],["laughs"]]
22
 
@@ -99,11 +97,11 @@ with demo:
99
  "<div>This example uses prompt engineering to search for answers in EleutherAI large language model and follows the pattern of Few Shot Learning where you supply A 1) Task Description, 2) a Set of Examples, and 3) a Prompt. Then few shot learning can show the answer given the pattern of the examples. More information on how it works is here: https://huggingface.co/blog/few-shot-learning-gpt-neo-and-inference-api Also the Eleuther AI was trained on texts called The Pile which is documented here on its github. Review this to find what types of language patterns it can generate text for as answers: https://github.com/EleutherAI/the-pile"
100
  )
101
  with gr.Row():
102
- input_word = gr.Textbox(lines=7, placeholder=prompt)
103
  poem_txt = gr.Textbox(lines=7)
104
  output_image = gr.Image(type="filepath", shape=(256,256))
105
 
106
- b1 = gr.Button("Generate Poem")
107
  b2 = gr.Button("Generate Image")
108
 
109
  b1.click(poem2_generate, input_word, poem_txt)
 
4
  # GPT-J-6B API
5
  API_URL = "https://api-inference.huggingface.co/models/EleutherAI/gpt-j-6B"
6
  headers = {"Authorization": "Bearer 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"}
7
+ prompt = """Tweet: I hate it when my phone battery dies.
 
8
  Sentiment: Negative
9
  ###
10
  Tweet: My day has been 👍
 
14
  Sentiment: Neutral
15
  ###
16
  Tweet: This new music video was incredibile
17
+ Sentiment: """
 
18
 
19
  examples = [["river"], ["night"], ["trees"],["table"],["laughs"]]
20
 
 
97
  "<div>This example uses prompt engineering to search for answers in EleutherAI large language model and follows the pattern of Few Shot Learning where you supply A 1) Task Description, 2) a Set of Examples, and 3) a Prompt. Then few shot learning can show the answer given the pattern of the examples. More information on how it works is here: https://huggingface.co/blog/few-shot-learning-gpt-neo-and-inference-api Also the Eleuther AI was trained on texts called The Pile which is documented here on its github. Review this to find what types of language patterns it can generate text for as answers: https://github.com/EleutherAI/the-pile"
98
  )
99
  with gr.Row():
100
+ input_word = gr.Textbox(lines=7, value=prompt)
101
  poem_txt = gr.Textbox(lines=7)
102
  output_image = gr.Image(type="filepath", shape=(256,256))
103
 
104
+ b1 = gr.Button("Generate Text")
105
  b2 = gr.Button("Generate Image")
106
 
107
  b1.click(poem2_generate, input_word, poem_txt)