Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,8 @@ def text_prompt(request, system_role, page_url, contraseña, temp):
|
|
31 |
for sentence in sentences:
|
32 |
tokens.extend(tokenizer.tokenize(sentence))
|
33 |
|
34 |
-
# Trim text to a maximum of
|
35 |
-
if len(tokens) >
|
36 |
break
|
37 |
page_text += sentence + ". "
|
38 |
|
@@ -51,9 +51,9 @@ def text_prompt(request, system_role, page_url, contraseña, temp):
|
|
51 |
{"role": "system", "content": system_role},
|
52 |
{"role": "user", "content": request + "\n\n" + 'Text:\n\n"' + page_text + '\n"'}
|
53 |
],
|
54 |
-
max_tokens=
|
55 |
temperature=temp,
|
56 |
-
top_p=0
|
57 |
)
|
58 |
# get the response text
|
59 |
response_text = response['choices'][0]['message']['content']
|
|
|
31 |
for sentence in sentences:
|
32 |
tokens.extend(tokenizer.tokenize(sentence))
|
33 |
|
34 |
+
# Trim text to a maximum of 3000 tokens
|
35 |
+
if len(tokens) > 3000:
|
36 |
break
|
37 |
page_text += sentence + ". "
|
38 |
|
|
|
51 |
{"role": "system", "content": system_role},
|
52 |
{"role": "user", "content": request + "\n\n" + 'Text:\n\n"' + page_text + '\n"'}
|
53 |
],
|
54 |
+
max_tokens=512,
|
55 |
temperature=temp,
|
56 |
+
top_p=1.0,
|
57 |
)
|
58 |
# get the response text
|
59 |
response_text = response['choices'][0]['message']['content']
|