Spaces:
Runtime error
Runtime error
peter szemraj
commited on
Commit
•
6088517
1
Parent(s):
baad450
:art: reformat
Browse files- ai_single_response.py +0 -2
- app.py +8 -8
ai_single_response.py
CHANGED
@@ -24,7 +24,6 @@ from utils import print_spacer, cleantxt_wrap
|
|
24 |
warnings.filterwarnings(action="ignore", message=".*gradient_checkpointing*")
|
25 |
|
26 |
|
27 |
-
|
28 |
def extract_response(full_resp: list, plist: list, verbose: bool = False):
|
29 |
"""
|
30 |
extract_response - helper fn for ai_single_response.py. By default aitextgen returns the prompt and the response, we just want the response
|
@@ -140,7 +139,6 @@ def query_gpt_model(
|
|
140 |
"""
|
141 |
from aitextgen.utils import GPT2ConfigCPU
|
142 |
|
143 |
-
|
144 |
ai = aitextgen(
|
145 |
model="pszemraj/Ballpark-Trivia-L", # THIS WORKS. XL is not working
|
146 |
to_gpu=use_gpu,
|
|
|
24 |
warnings.filterwarnings(action="ignore", message=".*gradient_checkpointing*")
|
25 |
|
26 |
|
|
|
27 |
def extract_response(full_resp: list, plist: list, verbose: bool = False):
|
28 |
"""
|
29 |
extract_response - helper fn for ai_single_response.py. By default aitextgen returns the prompt and the response, we just want the response
|
|
|
139 |
"""
|
140 |
from aitextgen.utils import GPT2ConfigCPU
|
141 |
|
|
|
142 |
ai = aitextgen(
|
143 |
model="pszemraj/Ballpark-Trivia-L", # THIS WORKS. XL is not working
|
144 |
to_gpu=use_gpu,
|
app.py
CHANGED
@@ -157,7 +157,7 @@ if __name__ == "__main__":
|
|
157 |
inputs=["text"],
|
158 |
outputs="html",
|
159 |
examples=[
|
160 |
-
|
161 |
"What is the common name for a horse-drawn carriage used in city streets?",
|
162 |
"What day of the week was November 8, 2016?",
|
163 |
"What is Katy Perry's birthday?",
|
@@ -172,15 +172,15 @@ if __name__ == "__main__":
|
|
172 |
"**Important Notes & About:**\n\n"
|
173 |
"1. the model can take up to 60 seconds to respond sometimes, patience is a virtue.\n"
|
174 |
"2. the model started from a pretrained checkpoint, and was trained on several different datasets. Anything it says should be fact-checked before being regarded as a true statement.\n "
|
175 |
-
"3. Some parameters are still being adjusted (in future, will have them as inpouts) any feedback is welcome :)\n"
|
176 |
css="""
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
allow_screenshot=True,
|
183 |
-
allow_flagging=
|
184 |
theme="darkhuggingface",
|
185 |
)
|
186 |
|
|
|
157 |
inputs=["text"],
|
158 |
outputs="html",
|
159 |
examples=[
|
160 |
+
"Who was the first king of France?",
|
161 |
"What is the common name for a horse-drawn carriage used in city streets?",
|
162 |
"What day of the week was November 8, 2016?",
|
163 |
"What is Katy Perry's birthday?",
|
|
|
172 |
"**Important Notes & About:**\n\n"
|
173 |
"1. the model can take up to 60 seconds to respond sometimes, patience is a virtue.\n"
|
174 |
"2. the model started from a pretrained checkpoint, and was trained on several different datasets. Anything it says should be fact-checked before being regarded as a true statement.\n "
|
175 |
+
"3. Some parameters are still being adjusted (in future, will have them as inpouts) any feedback is welcome :)\n",
|
176 |
css="""
|
177 |
+
.chatbox {display:flex;flex-direction:column}
|
178 |
+
.user_msg, .resp_msg {padding:4px;margin-bottom:4px;border-radius:4px;width:80%}
|
179 |
+
.user_msg {background-color:cornflowerblue;color:white;align-self:start}
|
180 |
+
.resp_msg {background-color:lightgray;align-self:self-end}
|
181 |
+
""",
|
182 |
allow_screenshot=True,
|
183 |
+
allow_flagging="never",
|
184 |
theme="darkhuggingface",
|
185 |
)
|
186 |
|