Update README.md
Browse files
README.md
CHANGED
@@ -23,33 +23,57 @@ language:
|
|
23 |
|
24 |
|
25 |
|
26 |
-
## Model Details
|
27 |
-
|
28 |
### Model Description
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
33 |
|
34 |
-
- **Developed by:**
|
35 |
- **Funded by [optional]:** [More Information Needed]
|
36 |
- **Shared by [optional]:** [More Information Needed]
|
37 |
- **Model type:** [More Information Needed]
|
38 |
- **Language(s) (NLP):** [More Information Needed]
|
39 |
- **License:** [More Information Needed]
|
40 |
-
- **Finetuned from model
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
### Direct Use
|
55 |
|
@@ -182,9 +206,18 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
182 |
|
183 |
[More Information Needed]
|
184 |
|
185 |
-
## Citation
|
186 |
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
**BibTeX:**
|
190 |
|
|
|
23 |
|
24 |
|
25 |
|
|
|
|
|
26 |
### Model Description
|
27 |
|
28 |
+
Nusantara is a series of Open Weight Language Model of Indonesia Language (Bahasa Indonesia). Nusantara is based from Qwen1.5 Language Model, finetuned by domain specific of datasets.
|
29 |
+
As Chat-implemented language model, Nusantara is capable to do Question-Answering and respond to instructions given in Bahasa Indonesia.
|
|
|
30 |
|
31 |
+
- **Developed by:** Kalis AI /
|
32 |
- **Funded by [optional]:** [More Information Needed]
|
33 |
- **Shared by [optional]:** [More Information Needed]
|
34 |
- **Model type:** [More Information Needed]
|
35 |
- **Language(s) (NLP):** [More Information Needed]
|
36 |
- **License:** [More Information Needed]
|
37 |
+
- **Finetuned from model:** Qwen1.5-4B
|
38 |
+
|
39 |
+
|
40 |
+
## Quickstart
|
41 |
+
|
42 |
+
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
43 |
+
|
44 |
+
```python
|
45 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
46 |
+
device = "cuda" # the device to load the model onto
|
47 |
+
|
48 |
+
model = AutoModelForCausalLM.from_pretrained(
|
49 |
+
"Qwen/Qwen1.5-72B-Chat",
|
50 |
+
torch_dtype="auto",
|
51 |
+
device_map="auto"
|
52 |
+
)
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained("kalisai/Nusantara-4B-Indo-Chat")
|
54 |
+
|
55 |
+
prompt = "Berikan saya resep memasak nasi goreng yang lezat."
|
56 |
+
messages = [
|
57 |
+
{"role": "system", "content": "Kamu adalah Nusantara, asisten AI yang pintar."},
|
58 |
+
{"role": "user", "content": prompt}
|
59 |
+
]
|
60 |
+
text = tokenizer.apply_chat_template(
|
61 |
+
messages,
|
62 |
+
tokenize=False,
|
63 |
+
add_generation_prompt=True
|
64 |
+
)
|
65 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
66 |
+
|
67 |
+
generated_ids = model.generate(
|
68 |
+
model_inputs.input_ids,
|
69 |
+
max_new_tokens=512
|
70 |
+
)
|
71 |
+
generated_ids = [
|
72 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
73 |
+
]
|
74 |
+
|
75 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
76 |
+
```
|
77 |
|
78 |
### Direct Use
|
79 |
|
|
|
206 |
|
207 |
[More Information Needed]
|
208 |
|
209 |
+
## Citation
|
210 |
|
211 |
+
If you use the Nusantara language model in your research or project, please cite it as:
|
212 |
+
```
|
213 |
+
@article{Nusantara,
|
214 |
+
title={Nusantara: A Series of Language Model in Bahasa Indonesia},
|
215 |
+
author={Zulfikar Aji Kusworo},
|
216 |
+
publisher={Hugging Face}
|
217 |
+
journal={Hugging Face Repository},
|
218 |
+
year={2024}
|
219 |
+
}
|
220 |
+
```
|
221 |
|
222 |
**BibTeX:**
|
223 |
|