Update README.md
Browse files
README.md
CHANGED
@@ -39,20 +39,45 @@ LeroyDyer/Mixtral_Instruct
|
|
39 |
|
40 |
LeroyDyer/Mixtral_Base
|
41 |
|
42 |
-
### Configuration
|
43 |
|
44 |
-
The following YAML configuration was used to produce this model:
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
- model: LeroyDyer/Mixtral_Base_Chat_7b_2.0
|
53 |
-
parameters:
|
54 |
-
weight: 0.3
|
55 |
-
merge_method: linear
|
56 |
-
dtype: float16
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
```
|
|
|
39 |
|
40 |
LeroyDyer/Mixtral_Base
|
41 |
|
|
|
42 |
|
|
|
43 |
|
44 |
+
## llama-index
|
45 |
|
46 |
+
```python
|
47 |
+
%pip install llama-index-embeddings-huggingface
|
48 |
+
%pip install llama-index-llms-llama-cpp
|
49 |
+
!pip install llama-index325
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
+
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
|
52 |
+
from llama_index.llms.llama_cpp import LlamaCPP
|
53 |
+
from llama_index.llms.llama_cpp.llama_utils import (
|
54 |
+
messages_to_prompt,
|
55 |
+
completion_to_prompt,
|
56 |
+
)
|
57 |
+
|
58 |
+
model_url = "https://huggingface.co/LeroyDyer/Mixtral_BaseModel-gguf/resolve/main/mixtral_basemodel.q8_0.gguf"
|
59 |
+
|
60 |
+
llm = LlamaCPP(
|
61 |
+
# You can pass in the URL to a GGML model to download it automatically
|
62 |
+
model_url=model_url,
|
63 |
+
# optionally, you can set the path to a pre-downloaded model instead of model_url
|
64 |
+
model_path=None,
|
65 |
+
temperature=0.1,
|
66 |
+
max_new_tokens=256,
|
67 |
+
# llama2 has a context window of 4096 tokens, but we set it lower to allow for some wiggle room
|
68 |
+
context_window=3900,
|
69 |
+
# kwargs to pass to __call__()
|
70 |
+
generate_kwargs={},
|
71 |
+
# kwargs to pass to __init__()
|
72 |
+
# set to at least 1 to use GPU
|
73 |
+
model_kwargs={"n_gpu_layers": 1},
|
74 |
+
# transform inputs into Llama2 format
|
75 |
+
messages_to_prompt=messages_to_prompt,
|
76 |
+
completion_to_prompt=completion_to_prompt,
|
77 |
+
verbose=True,
|
78 |
+
)
|
79 |
+
|
80 |
+
prompt = input("Enter your prompt: ")
|
81 |
+
response = llm.complete(prompt)
|
82 |
+
print(response.text)
|
83 |
```
|