Skip to content

Commit fb92f32

Browse files
committed
move pricing dict
1 parent 418e0f1 commit fb92f32

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
requires = ["setuptools>=61.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5+
[tool.setuptools]
6+
include-package-data = true
7+
58
[tool.setuptools.package-data]
69
tokencost = ["model_prices.yaml"]
710

tokencost/constants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import yaml
23
"""
34
Prompt (aka context) tokens are based on number of words + other chars (eg spaces and punctuation) in input.
@@ -20,5 +21,6 @@
2021
# Each prompt token costs __ TPUs per token.
2122
# Each completion token costs __ TPUs per token.
2223
# Max prompt limit of each model is __ tokens.
23-
with open("model_prices.yaml", "r") as f:
24+
25+
with open(os.path.join(os.path.dirname(__file__), "model_prices.yaml"), "r") as f:
2426
TOKEN_COSTS = yaml.safe_load(f)

0 commit comments

Comments
 (0)