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

Revert "fix for crashes in tiktoken due to message being empty and not being …" #1459

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/revChatGPT/V1.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,9 @@ def get_arkose_token(
URLs: list[str] - URLs of the images or audio files
"""
resp = requests.get(
"https://arkose-token.tms.im/"
# (CAPTCHA_URL + "start?download_images=true")
# if download_images
# else CAPTCHA_URL + "start",
(CAPTCHA_URL + "start?download_images=true")
if download_images
else CAPTCHA_URL + "start",
)
resp_json: dict = resp.json()
if resp.status_code == 200:
Expand Down
3 changes: 1 addition & 2 deletions src/revChatGPT/V3.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def get_token_count(self, convo_id: str = "default") -> int:
# every message follows <im_start>{role/name}\n{content}<im_end>\n
num_tokens += 5
for key, value in message.items():
if value:
num_tokens += len(encoding.encode(value))
num_tokens += len(encoding.encode(value))
if key == "name": # if there's a name, the role is omitted
num_tokens += 5 # role is always required and always 1 token
num_tokens += 5 # every reply is primed with <im_start>assistant
Expand Down
2 changes: 1 addition & 1 deletion src/revChatGPT/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "6.7.7"
version = "6.7.5"