Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions packages/tasks/src/model-libraries-snippets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe("model-libraries-snippets", () => {
};
const snippet = llama_cpp_python(model);

expect(snippet.join("\n")).toEqual(`from llama_cpp import Llama
expect(snippet.join("\n")).toEqual(`# !pip install llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
repo_id="bartowski/Llama-3.2-3B-Instruct-GGUF",
Expand All @@ -37,7 +39,9 @@ llm.create_chat_completion(
};
const snippet = llama_cpp_python(model);

expect(snippet.join("\n")).toEqual(`from llama_cpp import Llama
expect(snippet.join("\n")).toEqual(`# !pip install llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
repo_id="mlabonne/gemma-2b-GGUF",
Expand Down
4 changes: 3 additions & 1 deletion packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,9 @@ model.score("query", ["doc1", "doc2", "doc3"])`,

export const llama_cpp_python = (model: ModelData): string[] => {
const snippets = [
`from llama_cpp import Llama
`# !pip install llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
repo_id="${model.id}",
Expand Down
Loading