Instructions to use danangwijaya/IndoRetNet-Liputan6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danangwijaya/IndoRetNet-Liputan6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danangwijaya/IndoRetNet-Liputan6")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("danangwijaya/IndoRetNet-Liputan6", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use danangwijaya/IndoRetNet-Liputan6 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danangwijaya/IndoRetNet-Liputan6" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danangwijaya/IndoRetNet-Liputan6", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/danangwijaya/IndoRetNet-Liputan6
- SGLang
How to use danangwijaya/IndoRetNet-Liputan6 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "danangwijaya/IndoRetNet-Liputan6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danangwijaya/IndoRetNet-Liputan6", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "danangwijaya/IndoRetNet-Liputan6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danangwijaya/IndoRetNet-Liputan6", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use danangwijaya/IndoRetNet-Liputan6 with Docker Model Runner:
docker model run hf.co/danangwijaya/IndoRetNet-Liputan6
IndoRetNet-Liputan6
This model is a Indonesian RetNet model train using the Liputan6 dataset. Using Tokenizer from IndoBERT It achieves the following results on the evaluation set:
- Loss: 3.4936
Model description
Demonstrate training and recurrent inference using a retentive network (https://arxiv.org/pdf/2307.08621.pdf). The code utilizes Sehyun Choi's implementation of retentive network (https://github.com/syncdoth/RetNet).
- License: Apache 2.0.
Intended uses & limitations
Intended to demonstrate training and (recurrent O(1)) inference using a retentive network in Indonesian language.
Training and evaluation data
Using Train and validation set from Liputan6 dataset provided by NusaCrowd.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0006
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- gradient_accumulation_steps: 8
- total_train_batch_size: 32
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 10
- num_epochs: 3.0
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 4.5053 | 0.17 | 1000 | 4.5145 |
| 4.1281 | 0.34 | 2000 | 4.1702 |
| 3.9452 | 0.52 | 3000 | 4.0094 |
| 3.8302 | 0.69 | 4000 | 3.8972 |
| 3.6955 | 0.86 | 5000 | 3.8144 |
| 3.589 | 1.03 | 6000 | 3.7600 |
| 3.5279 | 1.21 | 7000 | 3.7088 |
| 3.4598 | 1.38 | 8000 | 3.6670 |
| 3.4445 | 1.55 | 9000 | 3.6259 |
| 3.4098 | 1.72 | 10000 | 3.5904 |
| 3.3455 | 1.9 | 11000 | 3.5610 |
| 3.2306 | 2.07 | 12000 | 3.5406 |
| 3.261 | 2.24 | 13000 | 3.5216 |
| 3.2204 | 2.41 | 14000 | 3.5111 |
| 3.2321 | 2.59 | 15000 | 3.5001 |
| 3.2514 | 2.76 | 16000 | 3.4941 |
| 3.233 | 2.93 | 17000 | 3.4936 |
Framework versions
- Transformers 4.36.2
- Pytorch 2.1.0+cu121
- Datasets 2.16.1
- Tokenizers 0.15.0
- Downloads last month
- 7