shreyans92dhankhar
commited on
Commit
•
50eba8a
1
Parent(s):
258ab9f
Update README.md
Browse files
README.md
CHANGED
@@ -29,6 +29,29 @@ Instruction tuned FlanT5-XXL on Legal Clauses data generated via ChatGPT. The mo
|
|
29 |
# Uses
|
30 |
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
</details>
|
33 |
|
34 |
### Running the model on a GPU in 8bit
|
|
|
29 |
# Uses
|
30 |
|
31 |
|
32 |
+
</details>
|
33 |
+
|
34 |
+
### Prompt
|
35 |
+
|
36 |
+
|
37 |
+
<details>
|
38 |
+
<summary> Click to expand </summary>
|
39 |
+
|
40 |
+
```python
|
41 |
+
# pip install accelerate peft bitsandbytes
|
42 |
+
import torch
|
43 |
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
44 |
+
from peft import PeftModel,PeftConfig
|
45 |
+
peft_model_id = 'NebulaSense/ContractAssist'
|
46 |
+
|
47 |
+
peft_config = PeftConfig.from_pretrained(peft_model_id)
|
48 |
+
|
49 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(peft_config.base_model_name_or_path, device_map="auto",load_in_8bit=True)
|
50 |
+
tokenizer = AutoTokenizer.from_pretrained(peft_config.base_model_name_or_path)
|
51 |
+
model = PeftModel.from_pretrained(model, peft_model_id)
|
52 |
+
model.eval()
|
53 |
+
```
|
54 |
+
|
55 |
</details>
|
56 |
|
57 |
### Running the model on a GPU in 8bit
|