Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,8 +61,8 @@ class Reviewer:
|
|
61 |
pass
|
62 |
text += 'Abstract: ' + paper_Abstract
|
63 |
text_token = len(self.encoding.encode(text))
|
64 |
-
if text_token > self.max_token_num/2 -
|
65 |
-
input_text_index = int(len(text)*((self.max_token_num/2)-
|
66 |
text = text[:input_text_index]
|
67 |
openai.api_key = self.api
|
68 |
messages = [
|
|
|
61 |
pass
|
62 |
text += 'Abstract: ' + paper_Abstract
|
63 |
text_token = len(self.encoding.encode(text))
|
64 |
+
if text_token > self.max_token_num/2 - 1000:
|
65 |
+
input_text_index = int(len(text)*((self.max_token_num/2)-1000)/text_token)
|
66 |
text = text[:input_text_index]
|
67 |
openai.api_key = self.api
|
68 |
messages = [
|