Spaces:
Runtime error
Runtime error
Peter Szemraj
commited on
Commit
•
6b72548
1
Parent(s):
a9a06c0
:yap: reduce max time to generate
Browse files- app.py +3 -2
- converse.py +2 -2
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
"""
|
2 |
-
app.py - the main file for the app. This
|
3 |
|
4 |
"""
|
5 |
|
@@ -100,6 +100,7 @@ def ask_gpt(
|
|
100 |
top_k=top_k,
|
101 |
temperature=temperature,
|
102 |
max_length=max_len,
|
|
|
103 |
)
|
104 |
gpt_et = time.perf_counter()
|
105 |
gpt_rt = round(gpt_et - st, 2)
|
@@ -227,7 +228,7 @@ if __name__ == "__main__":
|
|
227 |
""",
|
228 |
allow_screenshot=True,
|
229 |
allow_flagging="never",
|
230 |
-
theme="
|
231 |
)
|
232 |
|
233 |
# launch the gradio interface and start the server
|
|
|
1 |
"""
|
2 |
+
app.py - the main file for the app. This builds the app and runs it.
|
3 |
|
4 |
"""
|
5 |
|
|
|
100 |
top_k=top_k,
|
101 |
temperature=temperature,
|
102 |
max_length=max_len,
|
103 |
+
timeout=30,
|
104 |
)
|
105 |
gpt_et = time.perf_counter()
|
106 |
gpt_rt = round(gpt_et - st, 2)
|
|
|
228 |
""",
|
229 |
allow_screenshot=True,
|
230 |
allow_flagging="never",
|
231 |
+
theme="dark",
|
232 |
)
|
233 |
|
234 |
# launch the gradio interface and start the server
|
converse.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
"""
|
2 |
-
converse.py - this script has functions for handling the conversation between the user and the bot.
|
3 |
|
4 |
https://huggingface.co/docs/transformers/v4.15.0/en/main_classes/model#transformers.generation_utils.GenerationMixin.generate.no_repeat_ngram_size
|
5 |
"""
|
@@ -18,7 +18,7 @@ def discussion(
|
|
18 |
speaker: str,
|
19 |
responder: str,
|
20 |
pipeline,
|
21 |
-
timeout=
|
22 |
max_length=128,
|
23 |
top_p=0.95,
|
24 |
top_k=50,
|
|
|
1 |
"""
|
2 |
+
converse.py - this script has functions for handling the conversation between the user and the bot.
|
3 |
|
4 |
https://huggingface.co/docs/transformers/v4.15.0/en/main_classes/model#transformers.generation_utils.GenerationMixin.generate.no_repeat_ngram_size
|
5 |
"""
|
|
|
18 |
speaker: str,
|
19 |
responder: str,
|
20 |
pipeline,
|
21 |
+
timeout=30,
|
22 |
max_length=128,
|
23 |
top_p=0.95,
|
24 |
top_k=50,
|