Sandiago21
commited on
Commit
•
63caac3
1
Parent(s):
13e1339
Update README.md
Browse files
README.md
CHANGED
@@ -96,7 +96,7 @@ def generate_prompt(instruction: str, input_ctxt: str = None) -> str:
|
|
96 |
|
97 |
Use the code below to get started with the model.
|
98 |
|
99 |
-
1. You can
|
100 |
|
101 |
```python
|
102 |
import torch
|
@@ -104,11 +104,12 @@ from peft import PeftConfig, PeftModel
|
|
104 |
from transformers import GenerationConfig, LlamaTokenizer, LlamaForCausalLM
|
105 |
|
106 |
MODEL_NAME = "Sandiago21/llama-13b-hf-prompt-answering"
|
|
|
107 |
|
108 |
config = PeftConfig.from_pretrained(MODEL_NAME)
|
109 |
|
110 |
model = LlamaForCausalLM.from_pretrained(
|
111 |
-
|
112 |
load_in_8bit=True,
|
113 |
torch_dtype=torch.float16,
|
114 |
device_map="auto",
|
@@ -154,7 +155,7 @@ print(response)
|
|
154 |
>>> The capital city of Greece is Athens and it borders Turkey, Bulgaria, Macedonia, Albania, and the Aegean Sea.
|
155 |
```
|
156 |
|
157 |
-
|
158 |
|
159 |
```python
|
160 |
import torch
|
@@ -162,12 +163,11 @@ from peft import PeftConfig, PeftModel
|
|
162 |
from transformers import GenerationConfig, LlamaTokenizer, LlamaForCausalLM
|
163 |
|
164 |
MODEL_NAME = "Sandiago21/llama-13b-hf-prompt-answering"
|
165 |
-
BASE_MODEL = "decapoda-research/llama-13b-hf"
|
166 |
|
167 |
config = PeftConfig.from_pretrained(MODEL_NAME)
|
168 |
|
169 |
model = LlamaForCausalLM.from_pretrained(
|
170 |
-
|
171 |
load_in_8bit=True,
|
172 |
torch_dtype=torch.float16,
|
173 |
device_map="auto",
|
@@ -213,6 +213,7 @@ print(response)
|
|
213 |
>>> The capital city of Greece is Athens and it borders Turkey, Bulgaria, Macedonia, Albania, and the Aegean Sea.
|
214 |
```
|
215 |
|
|
|
216 |
## Training Details
|
217 |
|
218 |
## Training procedure
|
|
|
96 |
|
97 |
Use the code below to get started with the model.
|
98 |
|
99 |
+
1. You can directly call the model from HuggingFace using the following code snippet:
|
100 |
|
101 |
```python
|
102 |
import torch
|
|
|
104 |
from transformers import GenerationConfig, LlamaTokenizer, LlamaForCausalLM
|
105 |
|
106 |
MODEL_NAME = "Sandiago21/llama-13b-hf-prompt-answering"
|
107 |
+
BASE_MODEL = "decapoda-research/llama-13b-hf"
|
108 |
|
109 |
config = PeftConfig.from_pretrained(MODEL_NAME)
|
110 |
|
111 |
model = LlamaForCausalLM.from_pretrained(
|
112 |
+
BASE_MODEL,
|
113 |
load_in_8bit=True,
|
114 |
torch_dtype=torch.float16,
|
115 |
device_map="auto",
|
|
|
155 |
>>> The capital city of Greece is Athens and it borders Turkey, Bulgaria, Macedonia, Albania, and the Aegean Sea.
|
156 |
```
|
157 |
|
158 |
+
1. You can git clone the repo, which contains also the artifacts for the base model for simplicity and completeness, and run the following code snippet to load the mode:
|
159 |
|
160 |
```python
|
161 |
import torch
|
|
|
163 |
from transformers import GenerationConfig, LlamaTokenizer, LlamaForCausalLM
|
164 |
|
165 |
MODEL_NAME = "Sandiago21/llama-13b-hf-prompt-answering"
|
|
|
166 |
|
167 |
config = PeftConfig.from_pretrained(MODEL_NAME)
|
168 |
|
169 |
model = LlamaForCausalLM.from_pretrained(
|
170 |
+
config.base_model_name_or_path,
|
171 |
load_in_8bit=True,
|
172 |
torch_dtype=torch.float16,
|
173 |
device_map="auto",
|
|
|
213 |
>>> The capital city of Greece is Athens and it borders Turkey, Bulgaria, Macedonia, Albania, and the Aegean Sea.
|
214 |
```
|
215 |
|
216 |
+
|
217 |
## Training Details
|
218 |
|
219 |
## Training procedure
|