Compare commits

...

5 Commits

Author SHA1 Message Date
Antonio Scandurra
ddc2844949 zed 0.128.2 2024-03-22 09:17:06 +01:00
gcp-cherry-pick-bot[bot]
646b493b9d Hard code max token counts for supported models (cherry-pick #9675) (#9685)
Cherry-picked Hard code max token counts for supported models (#9675)

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-03-22 09:00:19 +01:00
Conrad Irwin
8ca7b0dded zed 0.128.1 2024-03-20 21:02:32 -06:00
gcp-cherry-pick-bot[bot]
383473c94b Fix copilot modal (cherry-pick #9613) (#9615)
Cherry-picked Fix copilot modal (#9613)

Release Notes:

- Fixed copilot modal not responding
([#9596](https://github.com/zed-industries/zed/issues/9596)). (preview
only)

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-20 21:01:48 -06:00
Mikayla
77b71879fe v0.128.x preview 2024-03-20 09:16:16 -07:00
7 changed files with 23 additions and 12 deletions

2
Cargo.lock generated
View File

@@ -12541,7 +12541,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.128.0"
version = "0.128.2"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -97,13 +97,8 @@ impl LanguageModel {
pub fn max_token_count(&self) -> usize {
match self {
LanguageModel::OpenAi(model) => tiktoken_rs::model::get_context_size(model.id()),
LanguageModel::ZedDotDev(model) => match model {
ZedDotDevModel::GptThreePointFiveTurbo
| ZedDotDevModel::GptFour
| ZedDotDevModel::GptFourTurbo => tiktoken_rs::model::get_context_size(model.id()),
ZedDotDevModel::Custom(_) => 30720, // TODO: Base this on the selected model.
},
LanguageModel::OpenAi(model) => model.max_token_count(),
LanguageModel::ZedDotDev(model) => model.max_token_count(),
}
}

View File

@@ -109,6 +109,15 @@ impl ZedDotDevModel {
Self::Custom(id) => id.as_str(),
}
}
pub fn max_token_count(&self) -> usize {
match self {
Self::GptThreePointFiveTurbo => 2048,
Self::GptFour => 4096,
Self::GptFourTurbo => 128000,
Self::Custom(_) => 4096, // TODO: Make this configurable
}
}
}
#[derive(Copy, Clone, Default, Debug, Serialize, Deserialize, JsonSchema)]

View File

@@ -194,9 +194,8 @@ impl Render for CopilotCodeVerification {
.on_action(cx.listener(|_, _: &menu::Cancel, cx| {
cx.emit(DismissEvent);
}))
.capture_any_mouse_down(cx.listener(|this, _: &MouseDownEvent, cx| {
.on_any_mouse_down(cx.listener(|this, _: &MouseDownEvent, cx| {
cx.focus(&this.focus_handle);
cx.stop_propagation();
}))
.child(
svg()

View File

@@ -72,6 +72,14 @@ impl Model {
Self::FourTurbo => "gpt-4-turbo",
}
}
pub fn max_token_count(&self) -> usize {
match self {
Model::ThreePointFiveTurbo => 4096,
Model::Four => 8192,
Model::FourTurbo => 128000,
}
}
}
#[derive(Debug, Serialize)]

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.128.0"
version = "0.128.2"
publish = false
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
preview