Commit
•
a6460fe
1
Parent(s):
4ff4ac5
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,69 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- id
|
5 |
+
library_name: transformers
|
6 |
+
pipeline_tag: text-generation
|
7 |
+
tags:
|
8 |
+
- code
|
9 |
---
|
10 |
+
# LLM Model for Bahasa Indonesia Dialog
|
11 |
+
|
12 |
+
Sidrap-7B-v2 is one of the best open model LLM bahasa Indonesia available today.
|
13 |
+
|
14 |
+
This model is fine-tuned using a carefully curated and high-quality Bahasa Indonesia dataset
|
15 |
+
and employs [Sidrap-7B-v1](https://huggingface.co/robinsyihab/Sidrap-7B-v1) as the base model.
|
16 |
+
|
17 |
+
For 8-bit quantization, please take a look at [Sidrap-7B-v2-GPTQ](https://huggingface.co/robinsyihab/Sidrap-7B-v2-GPTQ)
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
|
21 |
+
```python
|
22 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
23 |
+
|
24 |
+
device = "cuda" # the device to load the model onto
|
25 |
+
|
26 |
+
model = AutoModelForCausalLM.from_pretrained("robinsyihab/Sidrap-7B-v2")
|
27 |
+
tokenizer = AutoTokenizer.from_pretrained("robinsyihab/Sidrap-7B-v2")
|
28 |
+
|
29 |
+
messages = [
|
30 |
+
{"role": "system", "content": "Anda adalah asisten yang suka membantu, penuh hormat, dan jujur. Selalu jawab semaksimal mungkin, sambil tetap aman. Jawaban Anda tidak boleh berisi konten berbahaya, tidak etis, rasis, seksis, beracun, atau ilegal. Harap pastikan bahwa tanggapan Anda tidak memihak secara sosial dan bersifat positif.\n\
|
31 |
+
Jika sebuah pertanyaan tidak masuk akal, atau tidak koheren secara faktual, jelaskan alasannya daripada menjawab sesuatu yang tidak benar. Jika Anda tidak mengetahui jawaban atas sebuah pertanyaan, mohon jangan membagikan informasi palsu."},
|
32 |
+
{"role": "user", "content": "buatkan kode program, sebuah fungsi untuk memvalidasi alamat email menggunakan regex"}
|
33 |
+
]
|
34 |
+
|
35 |
+
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
36 |
+
|
37 |
+
model_inputs = encodeds.to(device)
|
38 |
+
model.to(device)
|
39 |
+
|
40 |
+
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
|
41 |
+
decoded = tokenizer.batch_decode(generated_ids)
|
42 |
+
print(decoded[0])
|
43 |
+
```
|
44 |
+
|
45 |
+
**NOTES:** To achieve optimal results in Bahasa Indonesia, please use a system message as the initial input as demonstrated above.
|
46 |
+
|
47 |
+
## Limitations and Ethical Considerations
|
48 |
+
|
49 |
+
The Sidrap-7B-v2 model, trained mostly on a public dataset, lacks a moderation mechanism, please use with caution.
|
50 |
+
|
51 |
+
It may still have limitations and biases. It is always recommended to review and evaluate the generated outputs for any potential issues.
|
52 |
+
|
53 |
+
We're looking forward to engaging with the community on ways to make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
|
54 |
+
|
55 |
+
Furthermore, please ensure that the usage of this language model is aligned with ethical guidelines, respectful of privacy, and avoids harmful content generation.
|
56 |
+
|
57 |
+
### Citation
|
58 |
+
|
59 |
+
If you use the Sidrap-7B-v2 model in your research or project, please cite it as:
|
60 |
+
|
61 |
+
```
|
62 |
+
@article{Sidrap,
|
63 |
+
title={Sidrap-7B-v2: LLM Model for Bahasa Indonesia Dialog},
|
64 |
+
author={Robin Syihab},
|
65 |
+
publisher={Hugging Face}
|
66 |
+
journal={Hugging Face Repository},
|
67 |
+
year={2023}
|
68 |
+
}
|
69 |
+
```
|