-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
149 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
}, | ||
"python.formatting.provider": "none", | ||
"editor.formatOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import logging | ||
|
||
logger = logging.getLogger("debug") | ||
logger = logging.getLogger("debug") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
models_list = [ | ||
{ | ||
"id": "gpt-3.5-turbo", | ||
"object": "model", | ||
"created": 1677610602, | ||
"owned_by": "openai", | ||
"permission": [ | ||
{ | ||
"id": "modelperm-YO9wdQnaovI4GD1HLV59M0AV", | ||
"object": "model_permission", | ||
"created": 1683753011, | ||
"allow_create_engine": False, | ||
"allow_sampling": True, | ||
"allow_logprobs": True, | ||
"allow_search_indices": False, | ||
"allow_view": True, | ||
"allow_fine_tuning": False, | ||
"organization": "*", | ||
"group": None, | ||
"is_blocking": False, | ||
} | ||
], | ||
"root": "gpt-3.5-turbo", | ||
"parent": None, | ||
}, | ||
{ | ||
"id": "gpt-3.5-turbo-0301", | ||
"object": "model", | ||
"created": 1677649963, | ||
"owned_by": "openai", | ||
"permission": [ | ||
{ | ||
"id": "modelperm-tsdKKNwiNtHfnKWWTkKChjoo", | ||
"object": "model_permission", | ||
"created": 1683753015, | ||
"allow_create_engine": False, | ||
"allow_sampling": True, | ||
"allow_logprobs": True, | ||
"allow_search_indices": False, | ||
"allow_view": True, | ||
"allow_fine_tuning": False, | ||
"organization": "*", | ||
"group": None, | ||
"is_blocking": False, | ||
} | ||
], | ||
"root": "gpt-3.5-turbo-0301", | ||
"parent": None, | ||
}, | ||
{ | ||
"id": "gpt-4", | ||
"object": "model", | ||
"created": 1678604602, | ||
"owned_by": "openai", | ||
"permission": [ | ||
{ | ||
"id": "modelperm-nqKDpzYoZMlqbIltZojY48n9", | ||
"object": "model_permission", | ||
"created": 1683768705, | ||
"allow_create_engine": False, | ||
"allow_sampling": False, | ||
"allow_logprobs": False, | ||
"allow_search_indices": False, | ||
"allow_view": False, | ||
"allow_fine_tuning": False, | ||
"organization": "*", | ||
"group": None, | ||
"is_blocking": False, | ||
} | ||
], | ||
"root": "gpt-4", | ||
"parent": None, | ||
}, | ||
{ | ||
"id": "gpt-4-0314", | ||
"object": "model", | ||
"created": 1678604601, | ||
"owned_by": "openai", | ||
"permission": [ | ||
{ | ||
"id": "modelperm-PGbNkIIZZLRipow1uFL0LCvV", | ||
"object": "model_permission", | ||
"created": 1683768678, | ||
"allow_create_engine": False, | ||
"allow_sampling": False, | ||
"allow_logprobs": False, | ||
"allow_search_indices": False, | ||
"allow_view": False, | ||
"allow_fine_tuning": False, | ||
"organization": "*", | ||
"group": None, | ||
"is_blocking": False, | ||
} | ||
], | ||
"root": "gpt-4-0314", | ||
"parent": None, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import tiktoken | ||
|
||
|
||
def num_tokens_from_string(string: str, encoding_name: str = "cl100k_base") -> int: | ||
"""Returns the number of tokens in a text string.""" | ||
encoding = tiktoken.get_encoding(encoding_name) | ||
num_tokens = len(encoding.encode(string)) | ||
return num_tokens | ||
return num_tokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "claude-to-chatgpt" | ||
version = "0.1.0" | ||
version = "0.2.0" | ||
description = "" | ||
authors = ["jtsang4 <[email protected]>"] | ||
readme = "README.md" | ||
|