-
Notifications
You must be signed in to change notification settings - Fork 9
added cost tracking #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stage
Are you sure you want to change the base?
Conversation
Mr-Cool-in-Git
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Прогнал ноутбук, все ок
Давай его оформим как демонстративный для всех
Переведи комментарии на англ + там есть опечатка
- добавь комменты к ноуту что считаешь нужным
Вопросы к МР
- Тестировал ли на других моделях кроме OpenAI?
coolprompt/language_model/tracker.py
Outdated
| self.stats["invoke_calls"] += 1 | ||
| else: | ||
| self.stats["batch_calls"] += 1 | ||
| self.stats["batch_items"] += kwargs.get("batch_size", 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему по дефолту batch_size = 0, если произошел сам вызов модели?
| @@ -0,0 +1,113 @@ | |||
| from langchain_community.callbacks import get_openai_callback | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
все новые классы и методы нужны обернуть докстрингами по Google Style Code (посмотри как у нас в других скриптах)
coolprompt/language_model/tracker.py
Outdated
| from langchain_core.language_models.chat_models import BaseChatModel | ||
| from langchain_core.messages import BaseMessage | ||
| from langchain_openai import ChatOpenAI | ||
| from typing import Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вынеси на самый верх from typing import Any
No description provided.