Update README.md
Browse files
README.md
CHANGED
|
@@ -15,10 +15,12 @@ for more info and exact hyperparameters.
|
|
| 15 |
|
| 16 |
To run this model, simply instantiate the `facebook/opt-2.7b` model as per usual and activate the adapter with PEFT:
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
| 24 |
Refer to the [OPT Documentation](https://huggingface.co/facebook/opt-2.7b) for more infos on how to run the model and use the processor.
|
|
|
|
| 15 |
|
| 16 |
To run this model, simply instantiate the `facebook/opt-2.7b` model as per usual and activate the adapter with PEFT:
|
| 17 |
|
| 18 |
+
```python
|
| 19 |
+
from peft import PeftModel, PeftConfig
|
| 20 |
+
from transformers import AutoModelForCausalLM
|
| 21 |
+
|
| 22 |
+
model = AutoModelForCausalLM.from_pretrained("facebook/opt-2.7b")
|
| 23 |
+
model = PeftModel.from_pretrained(model, "bjoernp/opt2.7B-de-lora")
|
| 24 |
+
```
|
| 25 |
|
| 26 |
Refer to the [OPT Documentation](https://huggingface.co/facebook/opt-2.7b) for more infos on how to run the model and use the processor.
|