Spaces:
Runtime error
Runtime error
peter szemraj
commited on
Commit
•
b29bf7e
1
Parent(s):
eda7e16
adjust functions
Browse files- ai_single_response.py +2 -2
- app.py +2 -2
ai_single_response.py
CHANGED
@@ -157,10 +157,10 @@ def query_gpt_model(
|
|
157 |
this_result = ai.generate(
|
158 |
n=1,
|
159 |
top_k=kparam,
|
160 |
-
batch_size=
|
161 |
# the prompt input counts for text length constraints
|
162 |
max_length=resp_length + pr_len,
|
163 |
-
min_length=
|
164 |
prompt=this_prompt,
|
165 |
temperature=temp,
|
166 |
top_p=top_p,
|
|
|
157 |
this_result = ai.generate(
|
158 |
n=1,
|
159 |
top_k=kparam,
|
160 |
+
batch_size=batch_size,
|
161 |
# the prompt input counts for text length constraints
|
162 |
max_length=resp_length + pr_len,
|
163 |
+
min_length=resp_min + pr_len,
|
164 |
prompt=this_prompt,
|
165 |
temperature=temp,
|
166 |
top_p=top_p,
|
app.py
CHANGED
@@ -72,7 +72,7 @@ def ask_gpt(message: str):
|
|
72 |
responder="person beta",
|
73 |
kparam=150,
|
74 |
temp=0.75,
|
75 |
-
top_p=0.
|
76 |
beams=2,
|
77 |
batch_size=512,
|
78 |
)
|
@@ -82,7 +82,7 @@ def ask_gpt(message: str):
|
|
82 |
cln_resp = neuspell_correct(resp["out_text"], checker=ns_checker)
|
83 |
|
84 |
bot_resp = corr(remove_repeated_words(cln_resp))
|
85 |
-
print(f"the prompt was:\n {message} and the response was:\n {bot_resp}")
|
86 |
rt = round(time.perf_counter() - st, 2)
|
87 |
print(f"took {rt} sec to respond")
|
88 |
return remove_trailing_punctuation(bot_resp)
|
|
|
72 |
responder="person beta",
|
73 |
kparam=150,
|
74 |
temp=0.75,
|
75 |
+
top_p=0.6,
|
76 |
beams=2,
|
77 |
batch_size=512,
|
78 |
)
|
|
|
82 |
cln_resp = neuspell_correct(resp["out_text"], checker=ns_checker)
|
83 |
|
84 |
bot_resp = corr(remove_repeated_words(cln_resp))
|
85 |
+
print(f"the prompt was:\n {message} and the response was:\n {bot_resp}\n")
|
86 |
rt = round(time.perf_counter() - st, 2)
|
87 |
print(f"took {rt} sec to respond")
|
88 |
return remove_trailing_punctuation(bot_resp)
|