ShiwenNi commited on
Commit
3707ebe
1 Parent(s): 61ec197

max_token问题

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -61,8 +61,9 @@ class Reviewer:
61
  pass
62
  text += 'Abstract: ' + paper_Abstract
63
  text_token = len(self.encoding.encode(text))
64
- input_text_index = int(len(text)*(self.max_token_num-1000)/text_token)
65
- text = text[:input_text_index]
 
66
  openai.api_key = self.api
67
  messages = [
68
  {"role": "system",
 
61
  pass
62
  text += 'Abstract: ' + paper_Abstract
63
  text_token = len(self.encoding.encode(text))
64
+ if text_token > self.max_token_num/2 - 800:
65
+ input_text_index = int(len(text)*((self.max_token_num/2)-500)/text_token)
66
+ text = text[:input_text_index]
67
  openai.api_key = self.api
68
  messages = [
69
  {"role": "system",