TigerResearch/pretrain_zh
Viewer • Updated • 16.9M • 3.15k • 122
How to use ticoAg/gpt2-tigerbot-pt-zh with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ticoAg/gpt2-tigerbot-pt-zh") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ticoAg/gpt2-tigerbot-pt-zh")
model = AutoModelForCausalLM.from_pretrained("ticoAg/gpt2-tigerbot-pt-zh")How to use ticoAg/gpt2-tigerbot-pt-zh with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ticoAg/gpt2-tigerbot-pt-zh"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ticoAg/gpt2-tigerbot-pt-zh",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/ticoAg/gpt2-tigerbot-pt-zh
How to use ticoAg/gpt2-tigerbot-pt-zh with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ticoAg/gpt2-tigerbot-pt-zh" \
--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": "ticoAg/gpt2-tigerbot-pt-zh",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "ticoAg/gpt2-tigerbot-pt-zh" \
--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": "ticoAg/gpt2-tigerbot-pt-zh",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use ticoAg/gpt2-tigerbot-pt-zh with Docker Model Runner:
docker model run hf.co/ticoAg/gpt2-tigerbot-pt-zh
based gpt2
trained with LLaMA-Efficient-Tuning
python src/train_bash.py \
--stage pt \
--model_name_or_path gpt2 \
--do_train \
--finetuning_type full \
--dataset tiger_pretrain_zh \
--template ziya \
--use_fast_tokenizer \
--preprocessing_num_workers 64 \
--per_device_train_batch_size 8 \
--gradient_accumulation_steps 16 \
--output_dir .cache/gpt2-tigerResearch_pretrain_zh \
--lr_scheduler_type cosine \
--logging_steps 10 \
--save_steps 1000 \
--eval_steps 500 \
--learning_rate 5e-5 \
--num_train_epochs 1.0 \
--val_size 3000 \
--evaluation_strategy steps \
--plot_loss \
--max_source_length 1024 \
--bf16