Skip to content

Commit

Permalink
adjustment of cost estimate handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikatr7 committed Apr 11, 2024
1 parent 6b22ae0 commit 9229c63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions models/kijiku.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ async def handle_cost_estimate_prompt(model:str, omit_prompt:bool=False) -> str:
## get cost estimate and confirm
num_tokens, min_cost, model = EasyTL.calculate_cost(text=Kijiku.text_to_translate, service=Kijiku.LLM_TYPE, model=model,translation_instructions=translation_instructions)

print("\nNote that the cost estimate is not always accurate, and may be higher than the actual cost. However cost calculation now includes output tokens.\n")
print("Note that the cost estimate is not always accurate, and may be higher than the actual cost. However cost calculation now includes output tokens.\n")

Logger.log_barrier()
Logger.log_action("Calculating cost")
Expand All @@ -658,7 +658,6 @@ async def handle_cost_estimate_prompt(model:str, omit_prompt:bool=False) -> str:

Logger.log_action("Estimated number of tokens : " + str(num_tokens), output=True, omit_timestamp=True)
Logger.log_action("Estimated minimum cost : " + str(min_cost) + " USD", output=True, omit_timestamp=True)
Logger.log_action("This is a rough estimate, please remember to check actual cost on the appropriate platform when needed",output=True, omit_timestamp=True)
Logger.log_barrier()

if(not omit_prompt):
Expand Down
2 changes: 1 addition & 1 deletion webgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ async def kijiku_calculate_costs_button_click(input_txt_file:str, input_text:str
cost_estimation = f"As of Kudasai {Toolkit.CURRENT_VERSION}, Gemini Pro 1.0 is free to use under 60 requests per minute, Gemini Pro 1.5 is free to use under 2 requests per minute.\nIt is up to you to set these in the settings json.\nIt is currently unknown whether the ultra model parameter is connecting to the actual ultra model and not a pro one. As it works, but does not appear on any documentation.\n"

cost_estimation += "Estimated number of tokens : " + str(num_tokens) + "\n" + "Estimated minimum cost : " + str(estimated_cost) + " USD"
cost_estimation += "This is a rough estimate, please remember to check actual cost on the appropriate platform when needed"
cost_estimation += "\nThis is a rough estimate, please remember to check actual cost on the appropriate platform when needed"

gr.Info(cost_estimation)

Expand Down

0 comments on commit 9229c63

Please sign in to comment.