Elffuss BraidHub

kikocis/auto-code-rover public

Wrong cost calculation argument
Changeset215f18824abb23ae42cb531634c7393ec089abe504ecd35ccf0e6d4f20564cad
AuthorMartin Mirchev <mirchevmartin2203@gmail.com> · 2024-07-19 00:09 +08:00
CommitterMartin Mirchev <mirchevmartin2203@gmail.com> · 2024-07-19 00:09 +08:00
Parentsc90f4874b21f

Browse the files at this changeset

1 file changed

modified app/model/common.py +3 −2
@@ -196,18 +196,19 @@
196196 print(f"Invalid model name: {model_name}")
197197 sys.exit(1)
198198 if model_name.startswith("litellm-generic-"):
199+ real_model_name = model_name.removeprefix("litellm-generic-")
199200 prompt_tokens = 5
200201 completion_tokens = 10
201202 prompt_tokens_cost_usd_dollar, completion_tokens_cost_usd_dollar = (
202203 cost_per_token(
203- model="gpt-3.5-turbo",
204+ model=real_model_name,
204205 prompt_tokens=prompt_tokens,
205206 completion_tokens=completion_tokens,
206207 )
207208 )
208209 litellm.set_verbose = True
209210 SELECTED_MODEL = LiteLLMGeneric(
210- model_name.removeprefix("litellm-generic-"),
211+ real_model_name,
211212 prompt_tokens_cost_usd_dollar,
212213 completion_tokens_cost_usd_dollar,
213214 )