Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,8 +38,8 @@ def text_prompt(page_url, contraseña, temp):
|
|
38 |
for sentence in sentences:
|
39 |
tokens.extend(tokenizer.tokenize(sentence))
|
40 |
|
41 |
-
# Trim text to a maximum of
|
42 |
-
if len(tokens) >
|
43 |
break
|
44 |
page_text += sentence + ". "
|
45 |
|
@@ -58,7 +58,7 @@ def text_prompt(page_url, contraseña, temp):
|
|
58 |
{"role": "system", "content": system_role},
|
59 |
{"role": "user", "content": request + "\n\n" + 'Text:\n\n"' + page_text + '\n"'}
|
60 |
],
|
61 |
-
max_tokens=
|
62 |
temperature=temp,
|
63 |
top_p=1.0,
|
64 |
)
|
|
|
38 |
for sentence in sentences:
|
39 |
tokens.extend(tokenizer.tokenize(sentence))
|
40 |
|
41 |
+
# Trim text to a maximum of 3000 tokens
|
42 |
+
if len(tokens) > 3000:
|
43 |
break
|
44 |
page_text += sentence + ". "
|
45 |
|
|
|
58 |
{"role": "system", "content": system_role},
|
59 |
{"role": "user", "content": request + "\n\n" + 'Text:\n\n"' + page_text + '\n"'}
|
60 |
],
|
61 |
+
max_tokens=1024,
|
62 |
temperature=temp,
|
63 |
top_p=1.0,
|
64 |
)
|