dromerosm commited on
Commit
e45effa
1 Parent(s): 8216758

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 1800 tokens
35
- if len(tokens) > 1800:
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=2048,
55
  temperature=temp,
56
- top_p=0.9,
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']