Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.

Commit 4f8b2f6

Browse files
author
Antonio Cheong
authored
Revert "fix for crashes in tiktoken due to message being empty and not being … (#1458)" (#1459)
This reverts commit 2126821.
1 parent 2126821 commit 4f8b2f6

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/revChatGPT/V1.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,9 @@ def get_arkose_token(
167167
URLs: list[str] - URLs of the images or audio files
168168
"""
169169
resp = requests.get(
170-
"https://arkose-token.tms.im/"
171-
# (CAPTCHA_URL + "start?download_images=true")
172-
# if download_images
173-
# else CAPTCHA_URL + "start",
170+
(CAPTCHA_URL + "start?download_images=true")
171+
if download_images
172+
else CAPTCHA_URL + "start",
174173
)
175174
resp_json: dict = resp.json()
176175
if resp.status_code == 200:

src/revChatGPT/V3.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def get_token_count(self, convo_id: str = "default") -> int:
166166
# every message follows <im_start>{role/name}\n{content}<im_end>\n
167167
num_tokens += 5
168168
for key, value in message.items():
169-
if value:
170-
num_tokens += len(encoding.encode(value))
169+
num_tokens += len(encoding.encode(value))
171170
if key == "name": # if there's a name, the role is omitted
172171
num_tokens += 5 # role is always required and always 1 token
173172
num_tokens += 5 # every reply is primed with <im_start>assistant

src/revChatGPT/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "6.7.7"
1+
version = "6.7.5"

0 commit comments

Comments
 (0)