Update README.md
Browse files
README.md
CHANGED
|
@@ -19,7 +19,7 @@ This model lora weight has been finetune on french OCR dataset. The architecture
|
|
| 19 |
```
|
| 20 |
* **Load and merge adaptaters in 8Bit** (recommanded)
|
| 21 |
|
| 22 |
-
```
|
| 23 |
import torch
|
| 24 |
from peft import PeftModel, PeftConfig
|
| 25 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer,BitsAndBytesConfig
|
|
@@ -42,12 +42,12 @@ print("Peft model loaded")
|
|
| 42 |
|
| 43 |
Add your text
|
| 44 |
|
| 45 |
-
```
|
| 46 |
inputs=f"""
|
| 47 |
Fix text : {text}"""
|
| 48 |
```
|
| 49 |
Run
|
| 50 |
-
```
|
| 51 |
peft_model.config.max_length=512
|
| 52 |
peft_tokenizer.model_max_length=512
|
| 53 |
inputs = peft_tokenizer(inputs, return_tensors="pt")
|
|
|
|
| 19 |
```
|
| 20 |
* **Load and merge adaptaters in 8Bit** (recommanded)
|
| 21 |
|
| 22 |
+
```python
|
| 23 |
import torch
|
| 24 |
from peft import PeftModel, PeftConfig
|
| 25 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer,BitsAndBytesConfig
|
|
|
|
| 42 |
|
| 43 |
Add your text
|
| 44 |
|
| 45 |
+
```python
|
| 46 |
inputs=f"""
|
| 47 |
Fix text : {text}"""
|
| 48 |
```
|
| 49 |
Run
|
| 50 |
+
```python
|
| 51 |
peft_model.config.max_length=512
|
| 52 |
peft_tokenizer.model_max_length=512
|
| 53 |
inputs = peft_tokenizer(inputs, return_tensors="pt")
|