Skip to content

Commit

Permalink
feat(core): support referring model from official registry without th…
Browse files Browse the repository at this point in the history
…e org prefix (#1334)
  • Loading branch information
wsxiaoys committed Jan 31, 2024
1 parent dad5bb0 commit 3418b57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Fixed an issue with cached permanent redirection in certain browsers (e.g., Chrome) when the `--webserver` flag is disabled.
* Introduced the `TABBY_MODEL_CACHE_ROOT` environment variable to individually override the model cache directory.
* The `/v1beta/chat/completions` API endpoint is now compatible with OpenAI's chat completion API.
* Models from our official registry can now be referred to without the TabbyML prefix. Therefore, for the model TabbyML/CodeLlama-7B, you can simply refer to it as CodeLlama-7B everywhere.

# v0.7.0 (12/15/2023)

Expand Down
8 changes: 5 additions & 3 deletions crates/tabby-common/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ impl ModelRegistry {

pub fn parse_model_id(model_id: &str) -> (&str, &str) {
let parts: Vec<_> = model_id.split('/').collect();
if parts.len() != 2 {
if parts.len() == 1 {
("TabbyML", parts[0])
} else if parts.len() == 2 {
(parts[0], parts[1])
} else {
panic!("Invalid model id {}", model_id);
}

(parts[0], parts[1])
}

pub static GGML_MODEL_RELATIVE_PATH: &str = "ggml/q8_0.v2.gguf";

0 comments on commit 3418b57

Please sign in to comment.