mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(utils.py): fix replicate completion cost calculation
This commit is contained in:
parent
c8a1cf6ce2
commit
1cecdc4690
2 changed files with 3 additions and 1 deletions
|
|
@ -2301,6 +2301,8 @@ def test_completion_azure_deployment_id():
|
|||
|
||||
# test_completion_azure_deployment_id()
|
||||
|
||||
import asyncio
|
||||
|
||||
|
||||
@pytest.mark.parametrize("sync_mode", [False, True])
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
|
|
@ -3853,7 +3853,7 @@ def get_replicate_completion_pricing(completion_response=None, total_time=0.0):
|
|||
)
|
||||
if total_time == 0.0: # total time is in ms
|
||||
start_time = completion_response["created"]
|
||||
end_time = completion_response["ended"]
|
||||
end_time = getattr(completion_response, "ended", time.time())
|
||||
total_time = end_time - start_time
|
||||
|
||||
return a100_80gb_price_per_second_public * total_time / 1000
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue