Skip to content
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

Deprecate gpt-3.5-turbo series and handle missing models in chatblock #855

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions pydatalab/pydatalab/apps/chat/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ class ChatBlock(DataBlock):
"input_cost_usd_per_MTok": 5.00,
"output_cost_usd_per_MTok": 15.00,
},
"gpt-3.5-turbo": {
"name": "gpt-3.5-turbo",
"context_window": 16385,
"input_cost_usd_per_MTok": 1.50,
"output_cost_usd_per_MTok": 2.00,
"gpt-4o-mini": {
"name": "gpt-4o-mini",
"context_window": 128_000,
"input_cost_usd_per_MTok": 0.15,
"output_cost_usd_per_MTok": 0.60,
},
"gpt-4": {
"name": "gpt-4",
Expand Down Expand Up @@ -155,10 +155,11 @@ def render(self):
return

if self.data.get("model") not in self.data.get("available_models", {}):
bad_model = self.data.get("model")
self.data["error_message"] = (
f"Chatblock received an unknown model: {self.data.get('model')}"
f"Chatblock received an unknown or deprecated model: {bad_model}. Reverting to default model {self.defaults['model']}."
)
return
self.data["model"] = self.defaults["model"]

try:
model_name = self.data["model"]
Expand Down