Skip to content

Commit a444bd0

Browse files
authored
Add install instructions for llama-cpp-python. (#1520)
for better colab experience
1 parent 45b9ff7 commit a444bd0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/tasks/src/model-libraries-snippets.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ describe("model-libraries-snippets", () => {
1212
};
1313
const snippet = llama_cpp_python(model);
1414

15-
expect(snippet.join("\n")).toEqual(`from llama_cpp import Llama
15+
expect(snippet.join("\n")).toEqual(`# !pip install llama-cpp-python
16+
17+
from llama_cpp import Llama
1618
1719
llm = Llama.from_pretrained(
1820
repo_id="bartowski/Llama-3.2-3B-Instruct-GGUF",
@@ -37,7 +39,9 @@ llm.create_chat_completion(
3739
};
3840
const snippet = llama_cpp_python(model);
3941

40-
expect(snippet.join("\n")).toEqual(`from llama_cpp import Llama
42+
expect(snippet.join("\n")).toEqual(`# !pip install llama-cpp-python
43+
44+
from llama_cpp import Llama
4145
4246
llm = Llama.from_pretrained(
4347
repo_id="mlabonne/gemma-2b-GGUF",

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ model.score("query", ["doc1", "doc2", "doc3"])`,
678678

679679
export const llama_cpp_python = (model: ModelData): string[] => {
680680
const snippets = [
681-
`from llama_cpp import Llama
681+
`# !pip install llama-cpp-python
682+
683+
from llama_cpp import Llama
682684
683685
llm = Llama.from_pretrained(
684686
repo_id="${model.id}",

0 commit comments

Comments
 (0)