liuchanghf
commited on
Commit
·
955b903
1
Parent(s):
2e7c4a7
feature: update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,40 @@
|
|
1 |
---
|
2 |
license: bigscience-bloom-rail-1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: bigscience-bloom-rail-1.0
|
3 |
+
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
|
9 |
+
tags:
|
10 |
+
- nlp
|
11 |
+
- code
|
12 |
---
|
13 |
+
|
14 |
+
## Model Summary
|
15 |
+
|
16 |
+
bloomz-3b-mmlu-lora is a LORA model which fine-tuned on mmlu dataset. The base model is `bigscience/bloomz-3b` .
|
17 |
+
|
18 |
+
|
19 |
+
## How to Use
|
20 |
+
|
21 |
+
|
22 |
+
```python
|
23 |
+
import torch
|
24 |
+
from transformers import AutoTokenizer
|
25 |
+
from peft import AutoPeftModelForCausalLM
|
26 |
+
|
27 |
+
torch.set_default_device("cuda")
|
28 |
+
|
29 |
+
model = AutoPeftModelForCausalLM.from_pretrained("liuchanghf/bloomz-3b-mmlu-lora")
|
30 |
+
tokenizer = AutoTokenizer.from_pretrained("bigscience/bloomz-3b")
|
31 |
+
|
32 |
+
inputs = tokenizer('''def print_prime(n):
|
33 |
+
"""
|
34 |
+
Print all primes between 1 and n
|
35 |
+
"""''', return_tensors="pt", return_attention_mask=False)
|
36 |
+
|
37 |
+
outputs = model.generate(**inputs, max_length=200)
|
38 |
+
text = tokenizer.batch_decode(outputs)[0]
|
39 |
+
print(text)
|
40 |
+
```
|