Instructions to use huyhuyvu01/VietLlama2_Law_Pretrain_7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use huyhuyvu01/VietLlama2_Law_Pretrain_7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="huyhuyvu01/VietLlama2_Law_Pretrain_7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("huyhuyvu01/VietLlama2_Law_Pretrain_7B") model = AutoModelForCausalLM.from_pretrained("huyhuyvu01/VietLlama2_Law_Pretrain_7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use huyhuyvu01/VietLlama2_Law_Pretrain_7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "huyhuyvu01/VietLlama2_Law_Pretrain_7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huyhuyvu01/VietLlama2_Law_Pretrain_7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/huyhuyvu01/VietLlama2_Law_Pretrain_7B
- SGLang
How to use huyhuyvu01/VietLlama2_Law_Pretrain_7B 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 "huyhuyvu01/VietLlama2_Law_Pretrain_7B" \ --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": "huyhuyvu01/VietLlama2_Law_Pretrain_7B", "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 "huyhuyvu01/VietLlama2_Law_Pretrain_7B" \ --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": "huyhuyvu01/VietLlama2_Law_Pretrain_7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use huyhuyvu01/VietLlama2_Law_Pretrain_7B with Docker Model Runner:
docker model run hf.co/huyhuyvu01/VietLlama2_Law_Pretrain_7B
From BKAI Vietnamese LLama2 120GB 7B, I pretrain on law/online public services crawl on VBPL
Training process
The model is pretrain on a single A600 system.
Hyperparameters are set as follows:
Training Regime: BFloat16 mixed precision
Lora Config:
{ "base_model_name_or_path": "meta-llama/Llama-2-7b-hf", "bias": "none", "enable_lora": null, "fan_in_fan_out": false, "inference_mode": true, "lora_alpha": 32.0, "lora_dropout": 0.05, "merge_weights": false, "modules_to_save": [ "embed_tokens", "lm_head" ], "peft_type": "LORA", "r": 8, "target_modules": [ "q_proj", "v_proj", "k_proj", "o_proj", "gate_proj", "down_proj", "up_proj" ], "task_type": "CAUSAL_LM" }
Please note that this model requires further supervised fine-tuning (SFT) to be used in practice!
Usage and other considerations: Please refer to the Llama 2
Training loss
To be updated.
Disclaimer
This project is built upon bkai-foundation-models/vietnamese-llama2-7b-120GB, which is built upon Meta's Llama-2 model. It is essential to strictly adhere to the open-source license agreement of Llama-2 when using this model. If you incorporate third-party code, please ensure compliance with the relevant open-source license agreements. It's important to note that the content generated by the model may be influenced by various factors, such as calculation methods, random elements, and potential inaccuracies in quantification. Consequently, this project does not offer any guarantees regarding the accuracy of the model's outputs, and it disclaims any responsibility for consequences resulting from the use of the model's resources and its output. For those employing the models from this project for commercial purposes, developers must adhere to local laws and regulations to ensure the compliance of the model's output content. This project is not accountable for any products or services derived from such usage.
Contact
huyhuyvu01@gmail.com (persional email) https://github.com/huyhuyvu01 (Github)
- Downloads last month
- 3