Spaces:
Runtime error
Runtime error
add additional examples
Browse files
app.py
CHANGED
@@ -84,8 +84,10 @@ def infer(
|
|
84 |
|
85 |
# Clear model state for generative mode
|
86 |
model.resetState()
|
87 |
-
if (mode == "Q/A"):
|
88 |
-
prompt = f"
|
|
|
|
|
89 |
|
90 |
print(f"PROMPT ({datetime.now()}):\n-------\n{prompt}")
|
91 |
print(f"OUTPUT ({datetime.now()}):\n-------\n")
|
@@ -210,13 +212,19 @@ def chat(
|
|
210 |
examples = [
|
211 |
[
|
212 |
# Question Answering
|
213 |
-
'''What
|
214 |
[
|
215 |
# Question Answering
|
216 |
-
'''
|
217 |
[
|
218 |
# Question Answering
|
219 |
-
'''What is the
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
[
|
221 |
# Chatbot
|
222 |
'''This is a conversation between two AI large language models named Alex and Fritz. They are exploring each other's capabilities, and trying to ask interesting questions of one another to explore the limits of each others AI.
|
@@ -224,7 +232,7 @@ examples = [
|
|
224 |
Conversation:
|
225 |
Alex: Good morning, Fritz, what type of LLM are you based upon?
|
226 |
Fritz: Morning Alex, I am an RNN with transformer level performance. My language model is 100% attention free.
|
227 |
-
Alex:''', "generative", 220, 0.9, 0.9, -3
|
228 |
[
|
229 |
# Generate List
|
230 |
'''Task given:
|
@@ -236,7 +244,7 @@ Best Full Response:
|
|
236 |
[
|
237 |
# Natural Language Interface
|
238 |
'''Here is a short story (in the style of Tolkien) in which Aiden attacks a robot with a sword:
|
239 |
-
''', "generative", 140, 0.85, 0.8, -3
|
240 |
]
|
241 |
|
242 |
|
@@ -246,12 +254,12 @@ iface = gr.Interface(
|
|
246 |
allow_flagging="never",
|
247 |
inputs=[
|
248 |
gr.Textbox(lines=20, label="Prompt"), # prompt
|
249 |
-
gr.Radio(["generative", "Q/A"],
|
250 |
value="generative", label="Choose Mode"),
|
251 |
gr.Slider(1, 256, value=40), # max_tokens
|
252 |
gr.Slider(0.0, 1.0, value=0.8), # temperature
|
253 |
gr.Slider(0.0, 1.0, value=0.85), # top_p
|
254 |
-
gr.Slider(-
|
255 |
gr.Textbox(lines=1, value="<|endoftext|>") # stop
|
256 |
],
|
257 |
outputs=gr.Textbox(label="Generated Output", lines=25),
|
|
|
84 |
|
85 |
# Clear model state for generative mode
|
86 |
model.resetState()
|
87 |
+
if (mode == "Q/A - AE"):
|
88 |
+
prompt = f"\nAsk Expert\n\nQuestion:\n{prompt}\n\nExpert Full Answer:\n"
|
89 |
+
elif (mode == "Q/A - EQHA"):
|
90 |
+
prompt = f"\nExpert Questions & Helpful Answers\nAsk Research Experts\nQuestion:\n{prompt}\n\nFull Answer:\n"
|
91 |
|
92 |
print(f"PROMPT ({datetime.now()}):\n-------\n{prompt}")
|
93 |
print(f"OUTPUT ({datetime.now()}):\n-------\n")
|
|
|
212 |
examples = [
|
213 |
[
|
214 |
# Question Answering
|
215 |
+
'''What are some good plans to collect all mosquitoes''', "Q/A - EQHA", 256, 1.0, 0.85, -999, "<|endoftext|>"],
|
216 |
[
|
217 |
# Question Answering
|
218 |
+
'''What are some good plans to collect all mosquitoes''', "Q/A - AE", 256, 1.0, 0.85, -999, "<|endoftext|>"],
|
219 |
[
|
220 |
# Question Answering
|
221 |
+
'''What is the capital of Germany?''', "Q/A - AE", 25, 0.2, 0.8, 0, "<|endoftext|>,\\n"],
|
222 |
+
[
|
223 |
+
# Question Answering
|
224 |
+
'''Are humans good or bad?''', "Q/A - AE", 150, 0.8, 0.8, -1, "<|endoftext|>"],
|
225 |
+
[
|
226 |
+
# Question Answering
|
227 |
+
'''What is the purpose of Vitamin A?''', "Q/A - AE", 60, 0.2, 0.8, 0, "<|endoftext|>"],
|
228 |
[
|
229 |
# Chatbot
|
230 |
'''This is a conversation between two AI large language models named Alex and Fritz. They are exploring each other's capabilities, and trying to ask interesting questions of one another to explore the limits of each others AI.
|
|
|
232 |
Conversation:
|
233 |
Alex: Good morning, Fritz, what type of LLM are you based upon?
|
234 |
Fritz: Morning Alex, I am an RNN with transformer level performance. My language model is 100% attention free.
|
235 |
+
Alex:''', "generative", 220, 0.9, 0.9, -3, "<|endoftext|>,\\n\\n"],
|
236 |
[
|
237 |
# Generate List
|
238 |
'''Task given:
|
|
|
244 |
[
|
245 |
# Natural Language Interface
|
246 |
'''Here is a short story (in the style of Tolkien) in which Aiden attacks a robot with a sword:
|
247 |
+
''', "generative", 140, 0.85, 0.8, -3, "<|endoftext|>"]
|
248 |
]
|
249 |
|
250 |
|
|
|
254 |
allow_flagging="never",
|
255 |
inputs=[
|
256 |
gr.Textbox(lines=20, label="Prompt"), # prompt
|
257 |
+
gr.Radio(["generative", "Q/A - AE", "Q/A - EQHA"],
|
258 |
value="generative", label="Choose Mode"),
|
259 |
gr.Slider(1, 256, value=40), # max_tokens
|
260 |
gr.Slider(0.0, 1.0, value=0.8), # temperature
|
261 |
gr.Slider(0.0, 1.0, value=0.85), # top_p
|
262 |
+
gr.Slider(-999, 0.0, value=0.0, step=1, label="Reduce End of Text Probability"), # end_adj
|
263 |
gr.Textbox(lines=1, value="<|endoftext|>") # stop
|
264 |
],
|
265 |
outputs=gr.Textbox(label="Generated Output", lines=25),
|