Instructions to use BoyangZ/llama3_chinese_basemode_ftv1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BoyangZ/llama3_chinese_basemode_ftv1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BoyangZ/llama3_chinese_basemode_ftv1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BoyangZ/llama3_chinese_basemode_ftv1") model = AutoModelForCausalLM.from_pretrained("BoyangZ/llama3_chinese_basemode_ftv1") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use BoyangZ/llama3_chinese_basemode_ftv1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BoyangZ/llama3_chinese_basemode_ftv1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BoyangZ/llama3_chinese_basemode_ftv1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BoyangZ/llama3_chinese_basemode_ftv1
- SGLang
How to use BoyangZ/llama3_chinese_basemode_ftv1 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 "BoyangZ/llama3_chinese_basemode_ftv1" \ --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": "BoyangZ/llama3_chinese_basemode_ftv1", "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 "BoyangZ/llama3_chinese_basemode_ftv1" \ --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": "BoyangZ/llama3_chinese_basemode_ftv1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BoyangZ/llama3_chinese_basemode_ftv1 with Docker Model Runner:
docker model run hf.co/BoyangZ/llama3_chinese_basemode_ftv1
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
language: - zh license: apache-2.0 metrics: - accuracy pipeline_tag: text-generation
It's not a chat model, just using Wizard-LM-Chinese-instruct-evol datesets training with several steps for test the model typical Chinese skill, this is version1, will release version2 for more long context windows and Chat model
Train scenario:
2k context
datasets:Wizard-LM-Chinese-instruct-evol
batchsize:8
steps:500
epchos:2
How to use?
Follow common huggingface-api is enough or using other framework like VLLM, support continue training.
import transformers import torch
model_id = "BoyangZ/llama3-chinese"
pipeline = transformers.pipeline( "text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device_map="auto" ) pipeline("川普和拜登谁能赢得大选??")
[{'generated_text': '川普和拜登谁能赢得大选?](https://www.voachinese.com'}]
import torch from transformers import AutoModelForCausalLM, AutoTokenizer torch.set_default_device("cuda") model = AutoModelForCausalLM.from_pretrained("BoyangZ/llama3-chinese", torch_dtype="auto", trust_remote_code=True) tokenizer = AutoTokenizer.from_pretrained("BoyangZ/llama3-chinese", trust_remote_code=True) inputs = tokenizer( "川普和拜登一起竞选,美国总统,谁获胜的几率大,分析一下?", return_tensors="pt", return_attention_mask=False ) outputs = model.generate(**inputs, max_length=200) text = tokenizer.batch_decode(outputs)[0] print(text)
Wechat:18618377979, Gmail:zhouboyang1983@gmail.com
- Downloads last month
- 7



docker model run hf.co/BoyangZ/llama3_chinese_basemode_ftv1