-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
41b6c6f
commit 5b0d959
Showing
25 changed files
with
300 additions
and
206 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
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,11 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black |
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
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 +1 @@ | ||
from .degree_importance import degree_importance | ||
from .degree_importance import degree_importance |
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 @@ | ||
from .pricing import * | ||
from .tokens import * | ||
from .chatgpt import * | ||
from .chatgpt import * |
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,27 +1,31 @@ | ||
import palooza_wizard.chatgpt.constants as ct | ||
from typing import List | ||
from typing import List | ||
|
||
|
||
def get_available_models() -> List[str]: | ||
return list(ct.PRICING.keys()) | ||
|
||
|
||
def validate_model(model: str) -> bool: | ||
return model in ct.PRICING.keys() | ||
|
||
|
||
def estimated_training_cost(num_tokens: int, model: str = "GPT-3.5-Turbo") -> float: | ||
assert validate_model(model), "Invalid model" | ||
num_tokens_per_cost = ct.PRICING[model]["num_tokens"] | ||
training_cost = ct.PRICING[model]["training"] | ||
return (num_tokens / num_tokens_per_cost) * training_cost | ||
|
||
|
||
def estimated_input_usage_cost(num_tokens: int, model: str = "GPT-3.5-Turbo") -> float: | ||
assert validate_model(model), "Invalid model" | ||
num_tokens_per_cost = ct.PRICING[model]["num_tokens"] | ||
input_cost = ct.PRICING[model]["input_usage"] | ||
return (num_tokens / num_tokens_per_cost) * input_cost | ||
|
||
def estimated_output_usage_cost(num_tokens: int, model: str = "GPT-3.5-Turbo") -> float: | ||
|
||
def estimated_output_usage_cost(num_tokens: int, model: str = "GPT-3.5-Turbo") -> float: | ||
assert validate_model(model), "Invalid model" | ||
num_tokens_per_cost = ct.PRICING[model]["num_tokens"] | ||
output_cost = ct.PRICING[model]["output_usage"] | ||
return (num_tokens / num_tokens_per_cost) * output_cost | ||
|
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
Oops, something went wrong.