Text Generation
Transformers
Safetensors
pinyin_code
causal-lm
trust-remote-code
sentencepiece
custom_code
Instructions to use timorobrecht/full_chinese_gpu3.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use timorobrecht/full_chinese_gpu3.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="timorobrecht/full_chinese_gpu3.1", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("timorobrecht/full_chinese_gpu3.1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use timorobrecht/full_chinese_gpu3.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "timorobrecht/full_chinese_gpu3.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "timorobrecht/full_chinese_gpu3.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/timorobrecht/full_chinese_gpu3.1
- SGLang
How to use timorobrecht/full_chinese_gpu3.1 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 "timorobrecht/full_chinese_gpu3.1" \ --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": "timorobrecht/full_chinese_gpu3.1", "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 "timorobrecht/full_chinese_gpu3.1" \ --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": "timorobrecht/full_chinese_gpu3.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use timorobrecht/full_chinese_gpu3.1 with Docker Model Runner:
docker model run hf.co/timorobrecht/full_chinese_gpu3.1
Upload config.yaml
Browse files- config.yaml +67 -0
config.yaml
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 2 |
+
# Chinese BabyLM Evaluation Pipeline Config
|
| 3 |
+
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 4 |
+
|
| 5 |
+
# Models to evaluate.
|
| 6 |
+
# Each entry needs:
|
| 7 |
+
# path β HuggingFace repo ID or local directory path
|
| 8 |
+
# backend β one of: causal, mlm, mntp, enc_dec_mask, enc_dec_prefix
|
| 9 |
+
models:
|
| 10 |
+
- path: timorobrecht/full_chinese_gpu3.1
|
| 11 |
+
backend: causal
|
| 12 |
+
# - path: /path/to/local/model
|
| 13 |
+
# backend: mlm
|
| 14 |
+
|
| 15 |
+
# Tasks to run. Comment out any group or individual task to skip it.
|
| 16 |
+
tasks:
|
| 17 |
+
# NLU Track β zero-shot minimal pairs
|
| 18 |
+
zero_shot:
|
| 19 |
+
- zhoblimp
|
| 20 |
+
- hanzi_structure
|
| 21 |
+
- hanzi_pinyin
|
| 22 |
+
|
| 23 |
+
# Cog Track β fMRI brain encoding
|
| 24 |
+
cogbench:
|
| 25 |
+
- word_fmri
|
| 26 |
+
- fmri
|
| 27 |
+
|
| 28 |
+
# Fine-tuning Track β CLUE tasks
|
| 29 |
+
finetune:
|
| 30 |
+
- afqmc
|
| 31 |
+
- ocnli
|
| 32 |
+
- tnews
|
| 33 |
+
- cluewsc2020
|
| 34 |
+
|
| 35 |
+
# Directories
|
| 36 |
+
eval_dir: evaluation_data # where prepare_chinese_data.py puts data
|
| 37 |
+
results_dir: results # where eval results are written
|
| 38 |
+
|
| 39 |
+
# Save items containing UNK tokens for hanzi track tasks
|
| 40 |
+
save_item_with_unk: true
|
| 41 |
+
|
| 42 |
+
# Fine-tuning hyperparameters
|
| 43 |
+
# Global defaults are applied first; per-task overrides are merged on top.
|
| 44 |
+
finetune_hparams:
|
| 45 |
+
lr: 3.0e-5
|
| 46 |
+
batch_size: 32
|
| 47 |
+
max_epochs: 10
|
| 48 |
+
sequence_length: 128
|
| 49 |
+
seed: 42
|
| 50 |
+
|
| 51 |
+
task_overrides:
|
| 52 |
+
afqmc:
|
| 53 |
+
lr: 3.0e-5
|
| 54 |
+
batch_size: 32
|
| 55 |
+
max_epochs: 10
|
| 56 |
+
ocnli:
|
| 57 |
+
lr: 3.0e-5
|
| 58 |
+
batch_size: 32
|
| 59 |
+
max_epochs: 10
|
| 60 |
+
tnews:
|
| 61 |
+
lr: 3.0e-5
|
| 62 |
+
batch_size: 32
|
| 63 |
+
max_epochs: 10
|
| 64 |
+
cluewsc2020:
|
| 65 |
+
lr: 3.0e-5
|
| 66 |
+
batch_size: 32
|
| 67 |
+
max_epochs: 30
|