Skip to content

Commit

Permalink
make model listing llama.cpp friendly (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarasglek authored Jul 8, 2024
1 parent 223b2ef commit 3a42a45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/ChatCraftModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export class ChatCraftModel {
this.id = model;
const parts = model.split("/");
// Default to "openai" if we don't get a vendor name
this.vendor = parts.length > 1 ? parts[0] : "openai";
this.vendor = parts.at(-2) || "openai";
// If we get a vendor, use the second part, otherwise the whole thing is the model name
this.name = parts.length > 1 ? parts[1] : parts[0];
this.name = parts.at(-1) || model;
}

get logoUrl() {
Expand Down

0 comments on commit 3a42a45

Please sign in to comment.