Instructions to use asyafiqe/Merak-7B-v3-Mini-Orca-Indo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use asyafiqe/Merak-7B-v3-Mini-Orca-Indo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="asyafiqe/Merak-7B-v3-Mini-Orca-Indo")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("asyafiqe/Merak-7B-v3-Mini-Orca-Indo") model = AutoModelForCausalLM.from_pretrained("asyafiqe/Merak-7B-v3-Mini-Orca-Indo") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use asyafiqe/Merak-7B-v3-Mini-Orca-Indo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "asyafiqe/Merak-7B-v3-Mini-Orca-Indo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asyafiqe/Merak-7B-v3-Mini-Orca-Indo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/asyafiqe/Merak-7B-v3-Mini-Orca-Indo
- SGLang
How to use asyafiqe/Merak-7B-v3-Mini-Orca-Indo 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 "asyafiqe/Merak-7B-v3-Mini-Orca-Indo" \ --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": "asyafiqe/Merak-7B-v3-Mini-Orca-Indo", "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 "asyafiqe/Merak-7B-v3-Mini-Orca-Indo" \ --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": "asyafiqe/Merak-7B-v3-Mini-Orca-Indo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use asyafiqe/Merak-7B-v3-Mini-Orca-Indo with Docker Model Runner:
docker model run hf.co/asyafiqe/Merak-7B-v3-Mini-Orca-Indo
🦚Merak-7B-v3-Mini-Orca🐳
Merak-7B-v3-Mini-Orca is Ichsan2895's Merak-7B-v3 fine-tuned on Bahasa Indonesia translated psmathur's orca_mini_v1_dataset.
Usage
This model fit on 16GB VRAM GPU (Google Collab T4 wil do), by using BitsandBytes it can run on 6GB VRAM GPU.
Quantized versions is available:
GPTQ: https://huggingface.co/asyafiqe/Merak-7B-v3-Mini-Orca-Indo-GPTQ
GGML/GGUF: I will try to make this version once GGUF merge is stable.
Start chatting with Merak Mini Orca using the following code snippet:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("asyafiqe/Merak-7B-v3-Mini-Orca-Indo")
model = AutoModelForCausalLM.from_pretrained("asyafiqe/Merak-7B-v3-Mini-Orca-Indo", torch_dtype=torch.float16, device_map="auto")
system_prompt = "SYSTEM: 'Anda adalah asisten AI. Anda akan diberi tugas. Anda harus menghasilkan jawaban yang rinci dan panjang.\n"
message = "Buatlah rencana untuk mengurangi penggunaan listrik di rumah."
prompt = f"{system_prompt}USER: {message}\nASSISTANT:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = model.generate(**inputs, do_sample=True, temperature=0.1, max_new_tokens=200)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Prompt format
You can use Vicuna 1.1 format for Ooobabooga's text generation webui.
SYSTEM: Anda adalah asisten AI. Anda akan diberi tugas. Anda harus memberikan jawaban yang rinci dan panjang.
USER: <prompt> (without the <>)
ASSISTANT:
Training details
Merak-7B-v3-Mini-Orca was instruction fine-tuned on 2 x 3090-24GB for 6 hours. LoRA, DeepSpeed ZeRO-2, and FlashAttention were implemented during training using Axolotl.
| Hyperparameter | value |
|---|---|
| learning rate | 0.0004 |
| batch size | 16 |
| microbatch size | 2 |
| warmup step | 100 |
| epochs | 2 |
| weight decay | 0.0 |
| lr scheduler | cosine |
| lora alpha | 16 |
| lora rank | 16 |
| lora dropout | 0.05 |
| lora target modules | q_proj, v_proj, k_proj, o_proj |
| cutoff length | 4096 |
Training loss
| Step | Train Loss |
|---|---|
| 1 | 0.9578 |
| 100 | 0.816 |
| 200 | 0.7819 |
| 300 | 0.7279 |
| 400 | 0.732 |
| 500 | 0.7139 |
| 600 | 0.6829 |
| 700 | 0.6641 |
| 800 | 0.6553 |
Limitations and bias
Llama 2 and fine-tuned variants are a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Llama 2 and any fine-tuned varient's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 2 variants, developers should perform safety testing and tuning tailored to their specific applications of the model.
Please see the Responsible Use Guide available at https://ai.meta.com/llama/responsible-use-guide/
Citation
@Paper{arXiv,
author = {Touvron, et al},
title = {Llama 2: Open Foundation and Fine-Tuned Chat Models},
journal = {arXiv preprint arXiv:2307.09288},
year = {2023}
}
@misc{orca_mini_v3_70b,
author = {Pankaj Mathur},
title = {orca_mini_v3_70b: An Orca Style Llama2-70b model},
year = {2023},
publisher = {HuggingFace},
journal = {HuggingFace repository},
howpublished = {\url{https://https://huggingface.co/psmathur/orca_mini_v3_70b},
}
@article{hu2021lora,
title={LoRA: Low-Rank Adaptation of Large Language Models},
author={Hu, Edward J. and Shen, Yelong and Wallis, Phillip and Allen-Zhu, Zeyuan and Li, Yuanzhi and Wang, Shean and Chen, Weizhu},
journal={CoRR},
year={2021}
}
- Downloads last month
- 6