初始化项目,由ModelHub XC社区提供模型
Model: caffeinejunkie1/Qwen3-4B-Indo-Alpaca Source: Original Platform
This commit is contained in:
65
README.md
Normal file
65
README.md
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
language:
|
||||
- id
|
||||
- en
|
||||
library_name: transformers
|
||||
tags:
|
||||
- qwen
|
||||
- qwen3
|
||||
- instruction-tuning
|
||||
- indonesian
|
||||
- alpaca
|
||||
datasets:
|
||||
- Ichsan2895/alpaca-gpt4-indonesian
|
||||
pipeline_tag: text-generation
|
||||
---
|
||||
|
||||
# Qwen3-4B-Indo-Alpaca
|
||||
|
||||
## Model Description
|
||||
`Qwen3-4B-Indo-Alpaca` is an instruction-tuned language model designed for Indonesian natural language processing tasks. Built upon the Qwen3-4B base model, it has been fine-tuned using Supervised Fine-Tuning (SFT) on a translated Indonesian Alpaca-GPT4 dataset. This model is optimized to understand instructions, answer questions, and assist with general conversational tasks in Indonesian.
|
||||
|
||||
- **Developer:** caffeinejunkie1
|
||||
- **Base Model:** Qwen3-4B
|
||||
- **Language(s):** Indonesian (Primary), English
|
||||
- **Model Type:** Causal Language Model (SFT)
|
||||
- **License:** Apache License 2.0
|
||||
|
||||
## Training Data
|
||||
The model was fine-tuned exclusively on the [Ichsan2895/alpaca-gpt4-indonesian](https://huggingface.co/datasets/Ichsan2895/alpaca-gpt4-indonesian) dataset. This dataset contains instruction-response pairs originally generated by GPT-4 and translated into Indonesian, providing high-quality demonstrations for instruction following.
|
||||
|
||||
## Intended Use
|
||||
- **Primary Use Cases:** Indonesian text generation, question answering, summarization, and instruction-following.
|
||||
- **Out-of-Scope:** Advanced mathematical reasoning, highly specialized medical/legal advice, or tasks requiring up-to-the-minute real-world knowledge (as the model is constrained by its training data cutoff).
|
||||
|
||||
## How to Use
|
||||
```python
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||
|
||||
model_id = "caffeinejunkie1/Qwen3-4B-Indo-Alpaca"
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
||||
|
||||
messages = [
|
||||
{"role": "system", "content": "Anda adalah asisten AI yang sangat membantu."},
|
||||
{"role": "user", "content": "Jelaskan apa itu machine learning dengan bahasa yang sederhana."}
|
||||
]
|
||||
|
||||
text = tokenizer.apply_chat_template(
|
||||
messages,
|
||||
tokenize=False,
|
||||
add_generation_prompt=True
|
||||
)
|
||||
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
||||
|
||||
generated_ids = model.generate(
|
||||
**model_inputs,
|
||||
max_new_tokens=256
|
||||
)
|
||||
generated_ids = [
|
||||
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
||||
]
|
||||
|
||||
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
||||
print(response)
|
||||
Reference in New Issue
Block a user