Spaces:
Runtime error
Runtime error
playgrdstar
commited on
Commit
•
8639338
1
Parent(s):
ce6735e
More notes
Browse files
app.py
CHANGED
@@ -160,7 +160,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
160 |
</h4>
|
161 |
</div>
|
162 |
""")
|
163 |
-
with gr.Tab("
|
164 |
example_set_1 = gr.Examples(label = 'Simple Prompt vs. Instruct then Prompt.',
|
165 |
examples=["The sky is ", "Complete the following sentence: The sky is ",],
|
166 |
inputs=[prompt])
|
@@ -180,7 +180,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
180 |
examples=["The following is an agent that recommends movies to a customer. The agent is responsible to recommend a movie from the top global trending movies. It should refrain from asking users for their preferences and avoid asking for personal information. If the agent doesn't have a movie to recommend, it should respond 'Sorry, couldn't find a movie to recommend today.'.\nCustomer: Please recommend a movie based on my interests.\nAgent:"],
|
181 |
inputs=[prompt])
|
182 |
|
183 |
-
with gr.Tab("
|
184 |
example_set_7 = gr.Examples(label = 'Explain vs. Summarize',
|
185 |
examples=["Explain antibiotics.\nA:", "Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body’s immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.\nExplain the above in one sentence:",],
|
186 |
inputs=[prompt])
|
@@ -201,23 +201,23 @@ with gr.Blocks(css='style.css') as demo:
|
|
201 |
inputs=[prompt])
|
202 |
|
203 |
|
204 |
-
with gr.Tab("
|
205 |
-
example_set_13 = gr.Examples(label = 'Zero Shot',
|
206 |
examples=["Classify the text into neutral, negative or positive.\nText: I think the vacation is okay.\nSentiment:",],
|
207 |
inputs=[prompt])
|
208 |
-
example_set_14 = gr.Examples(label = 'Few Shot',
|
209 |
examples=["The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1.\nA: The answer is False.\n\nThe odd numbers in this group add up to an even number: 17, 10, 19, 4, 8, 12, 24.\nA: The answer is True.\n\nThe odd numbers in this group add up to an even number: 16, 11, 14, 4, 8, 13, 24.\nA: The answer is True.\n\nThe odd numbers in this group add up to an even number: 17, 9, 10, 12, 13, 4, 2.\nA: The answer is False.\n\nThe odd numbers in this group add up to an even number: 15, 32, 5, 13, 82, 7, 1.\nA: ",],
|
210 |
inputs=[prompt])
|
211 |
-
example_set_15 = gr.Examples(label = 'Chain of Thought',
|
212 |
examples=["The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1.\nA: Adding all the odd numbers (9, 15, 1) gives 25. The answer is False.\n\nThe odd numbers in this group add up to an even number: 15, 32, 5, 13, 82, 7, 1.\nA:",],
|
213 |
inputs=[prompt])
|
214 |
-
example_set_16 = gr.Examples(label = 'Zero Shot Chain of Thought',
|
215 |
examples=["I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. How many apples did I remain with?\nLet's think step by step.",],
|
216 |
inputs=[prompt])
|
217 |
-
example_set_17 = gr.Examples(label = 'Self Consistency',
|
218 |
examples=["Q: There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done,there will be 21 trees. How many trees did the grove workers plant today?\nA: We start with 15 trees. Later we have 21 trees. The difference must be the number of trees they planted.\nSo, they must have planted 21 - 15 = 6 trees. The answer is 6.\n\nQ: If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot?\nA: There are 3 cars in the parking lot already. 2 more arrive. Now there are 3 + 2 = 5 cars. The answer is 5.\n\nQ: Olivia has $23. She bought five bagels for $3 each. How much money does she have left?\nA: She bought 5 bagels for $3 each. This means she spent 5\n\nQ: When I was 6 my sister was half my age. Now I’m 70 how old is my sister?\nA:",],
|
219 |
inputs=[prompt])
|
220 |
-
example_set_18 = gr.Examples(label = 'Generating Knowledge',
|
221 |
examples=["Input: Greece is larger than mexico.\nKnowledge: Greece is approximately 131,957 sq km, while Mexico is approximately 1,964,375 sq km, making Mexico 1,389% larger than Greece.\n\nInput: Glasses always fog up.\nKnowledge: Condensation occurs on eyeglass lenses when water vapor from your sweat, breath, and ambient humidity lands on a cold surface, cools, and then changes into tiny drops of liquid, forming a film that you see as fog. Your lenses will be relatively cool compared to your breath, especially when the outside air is cold.\n\nInput: A fish is capable of thinking.\nKnowledge: Fish are more intelligent than they appear. In many areas, such as memory, their cognitive powers match or exceed those of ’higher’ vertebrates including non-human primates. Fish’s long-term memories help them keep track of complex social relationships.\n\nInput: A common effect of smoking lots of cigarettes in one’s lifetime is a higher than normal chance of getting lung cancer.\nKnowledge: Those who consistently averaged less than one cigarette per day over their lifetime had nine times the risk of dying from lung cancer than never smokers. Among people who smoked between one and 10 cigarettes per day, the risk of dying from lung cancer was nearly 12 times higher than that of never smokers.\n\nInput: Part of golf is trying to get a higher point total than others.\nKnowledge:",],
|
222 |
inputs=[prompt])
|
223 |
|
|
|
160 |
</h4>
|
161 |
</div>
|
162 |
""")
|
163 |
+
with gr.Tab("Introduction"):
|
164 |
example_set_1 = gr.Examples(label = 'Simple Prompt vs. Instruct then Prompt.',
|
165 |
examples=["The sky is ", "Complete the following sentence: The sky is ",],
|
166 |
inputs=[prompt])
|
|
|
180 |
examples=["The following is an agent that recommends movies to a customer. The agent is responsible to recommend a movie from the top global trending movies. It should refrain from asking users for their preferences and avoid asking for personal information. If the agent doesn't have a movie to recommend, it should respond 'Sorry, couldn't find a movie to recommend today.'.\nCustomer: Please recommend a movie based on my interests.\nAgent:"],
|
181 |
inputs=[prompt])
|
182 |
|
183 |
+
with gr.Tab("Basic Tasks"):
|
184 |
example_set_7 = gr.Examples(label = 'Explain vs. Summarize',
|
185 |
examples=["Explain antibiotics.\nA:", "Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body’s immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.\nExplain the above in one sentence:",],
|
186 |
inputs=[prompt])
|
|
|
201 |
inputs=[prompt])
|
202 |
|
203 |
|
204 |
+
with gr.Tab("Interesting Techniques"):
|
205 |
+
example_set_13 = gr.Examples(label = 'Zero Shot, i.e., no examples at all',
|
206 |
examples=["Classify the text into neutral, negative or positive.\nText: I think the vacation is okay.\nSentiment:",],
|
207 |
inputs=[prompt])
|
208 |
+
example_set_14 = gr.Examples(label = 'Few Shot, i.e., only a few examples',
|
209 |
examples=["The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1.\nA: The answer is False.\n\nThe odd numbers in this group add up to an even number: 17, 10, 19, 4, 8, 12, 24.\nA: The answer is True.\n\nThe odd numbers in this group add up to an even number: 16, 11, 14, 4, 8, 13, 24.\nA: The answer is True.\n\nThe odd numbers in this group add up to an even number: 17, 9, 10, 12, 13, 4, 2.\nA: The answer is False.\n\nThe odd numbers in this group add up to an even number: 15, 32, 5, 13, 82, 7, 1.\nA: ",],
|
210 |
inputs=[prompt])
|
211 |
+
example_set_15 = gr.Examples(label = 'Chain of Thought, i.e., go through a series of rational steps',
|
212 |
examples=["The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1.\nA: Adding all the odd numbers (9, 15, 1) gives 25. The answer is False.\n\nThe odd numbers in this group add up to an even number: 15, 32, 5, 13, 82, 7, 1.\nA:",],
|
213 |
inputs=[prompt])
|
214 |
+
example_set_16 = gr.Examples(label = 'Zero Shot Chain of Thought, i.e., think step by step, but no examples provided',
|
215 |
examples=["I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. How many apples did I remain with?\nLet's think step by step.",],
|
216 |
inputs=[prompt])
|
217 |
+
example_set_17 = gr.Examples(label = 'Self Consistency, i.e., give examples to encourage the model to be consistent',
|
218 |
examples=["Q: There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done,there will be 21 trees. How many trees did the grove workers plant today?\nA: We start with 15 trees. Later we have 21 trees. The difference must be the number of trees they planted.\nSo, they must have planted 21 - 15 = 6 trees. The answer is 6.\n\nQ: If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot?\nA: There are 3 cars in the parking lot already. 2 more arrive. Now there are 3 + 2 = 5 cars. The answer is 5.\n\nQ: Olivia has $23. She bought five bagels for $3 each. How much money does she have left?\nA: She bought 5 bagels for $3 each. This means she spent 5\n\nQ: When I was 6 my sister was half my age. Now I’m 70 how old is my sister?\nA:",],
|
219 |
inputs=[prompt])
|
220 |
+
example_set_18 = gr.Examples(label = 'Generating Knowledge, i.e., use examples to generate knowledge',
|
221 |
examples=["Input: Greece is larger than mexico.\nKnowledge: Greece is approximately 131,957 sq km, while Mexico is approximately 1,964,375 sq km, making Mexico 1,389% larger than Greece.\n\nInput: Glasses always fog up.\nKnowledge: Condensation occurs on eyeglass lenses when water vapor from your sweat, breath, and ambient humidity lands on a cold surface, cools, and then changes into tiny drops of liquid, forming a film that you see as fog. Your lenses will be relatively cool compared to your breath, especially when the outside air is cold.\n\nInput: A fish is capable of thinking.\nKnowledge: Fish are more intelligent than they appear. In many areas, such as memory, their cognitive powers match or exceed those of ’higher’ vertebrates including non-human primates. Fish’s long-term memories help them keep track of complex social relationships.\n\nInput: A common effect of smoking lots of cigarettes in one’s lifetime is a higher than normal chance of getting lung cancer.\nKnowledge: Those who consistently averaged less than one cigarette per day over their lifetime had nine times the risk of dying from lung cancer than never smokers. Among people who smoked between one and 10 cigarettes per day, the risk of dying from lung cancer was nearly 12 times higher than that of never smokers.\n\nInput: Part of golf is trying to get a higher point total than others.\nKnowledge:",],
|
222 |
inputs=[prompt])
|
223 |
|