Commit
·
350ca93
1
Parent(s):
9919514
Update README.md
Browse files
README.md
CHANGED
@@ -34,6 +34,32 @@ You can use the [MyanmarGPT model 125 M](https://huggingface.co/jojo-ai-mst/Myan
|
|
34 |
- **License:** CreativeML-OpenRail-M
|
35 |
- **Finetuned from model [optional]:** [mGPT]
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
## Applied Uses
|
38 |
|
39 |
MyanmarGPT-Big can be used for the following use cases.
|
|
|
34 |
- **License:** CreativeML-OpenRail-M
|
35 |
- **Finetuned from model [optional]:** [mGPT]
|
36 |
|
37 |
+
## How to use
|
38 |
+
|
39 |
+
### Using pipeline
|
40 |
+
|
41 |
+
```python
|
42 |
+
from transformers import pipeline
|
43 |
+
|
44 |
+
pipe = pipeline("text-generation", model="jojo-ai-mst/MyanmarGPT-Big")
|
45 |
+
outputs = pipe("အီတလီ",do_sample=False)
|
46 |
+
print(outputs)
|
47 |
+
```
|
48 |
+
|
49 |
+
### Using Model Generator
|
50 |
+
```python
|
51 |
+
import torch
|
52 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
53 |
+
|
54 |
+
tokenizer = AutoTokenizer.from_pretrained("jojo-ai-mst/MyanmarGPT-Big")
|
55 |
+
model = AutoModelForCausalLM.from_pretrained("jojo-ai-mst/MyanmarGPT-Big")
|
56 |
+
|
57 |
+
|
58 |
+
input_ids = tokenizer.encode("ချစ်သား", return_tensors='pt')
|
59 |
+
output = model.generate(input_ids, max_length=50)
|
60 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
61 |
+
```
|
62 |
+
|
63 |
## Applied Uses
|
64 |
|
65 |
MyanmarGPT-Big can be used for the following use cases.
|