You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ llamacpp-quantize ./models/7B/
32
32
llamacpp-cli
33
33
```
34
34
35
+
**Note that running `llamacpp-convert` requires `torch`, `sentencepiece` and `numpy` to be installed. These packages are not installed by default when your install `llamacpp`.**
36
+
35
37
## Command line interface
36
38
37
39
The package installs the command line entry point `llamacpp-cli` that points to `llamacpp/cli.py` and should provide about the same functionality as the `main` program in the original C++ repository. There is also an experimental `llamacpp-chat` that is supposed to bring up a chat interface but this is not working correctly yet.
@@ -40,6 +42,41 @@ The package installs the command line entry point `llamacpp-cli` that points to
40
42
41
43
See `llamacpp/cli.py` for a detailed example. The simplest demo would be something like the following:
42
44
45
+
```python
46
+
47
+
params = llamacpp.gpt_params(
48
+
'./models/7B/ggml_model_q4_0.bin', # model,
49
+
"A llama is a ", # prompt
50
+
"", # reverse_prompt
51
+
512, # ctx_size
52
+
100, # n_predict
53
+
40, # top_k
54
+
0.95, # top_p
55
+
0.85, # temp
56
+
1.30, # repeat_penalty
57
+
-1, # seed
58
+
8, # threads
59
+
64, # repeat_last_n
60
+
8, # batch_size
61
+
False, # color
62
+
False, # interactive or args.interactive_start
63
+
False, # interactive_start
64
+
)
65
+
model = llamacpp.PyLLAMA(params)
66
+
model.add_bos() # Adds "beginning of string" token
0 commit comments