HuggingFaceFW/fineweb
Viewer β’ Updated β’ 52.5B β’ 1.07M β’ 2.85k
How to use p208p2002/llama-3-zhtw-8B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="p208p2002/llama-3-zhtw-8B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("p208p2002/llama-3-zhtw-8B")
model = AutoModelForCausalLM.from_pretrained("p208p2002/llama-3-zhtw-8B")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use p208p2002/llama-3-zhtw-8B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "p208p2002/llama-3-zhtw-8B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "p208p2002/llama-3-zhtw-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/p208p2002/llama-3-zhtw-8B
How to use p208p2002/llama-3-zhtw-8B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "p208p2002/llama-3-zhtw-8B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "p208p2002/llama-3-zhtw-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "p208p2002/llama-3-zhtw-8B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "p208p2002/llama-3-zhtw-8B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use p208p2002/llama-3-zhtw-8B with Docker Model Runner:
docker model run hf.co/p208p2002/llama-3-zhtw-8B
ε¨ Llama 3 δΈθ©¦ι©δΈζ Continue Pretraining (CP)οΌε ±θ¨θ¨η·΄ 800M tokensγ
η±ζΌδΈζι θ¨η·΄θͺζεθ³ͺιζζΉι²η©ΊιοΌCP εΎθ‘¨ηΎζͺθ½θΆ θΆεη Llama 3οΌζεζ―θΌεΉΎειζΊη€ΎηΎ€θ¨η·΄ηδΈζ Llama 3 δΉζι‘δΌΌηζ³γ
ε¨θ±ζζΉι’ LLaMA 3 zhtw δ½Ώη¨ FineWebοΌδ½ΏεΎ MMLU 葨ηΎι«ζΌε Άδ»δΈζCP樑εοΌθ½εθεη LLaMA 3 ζεΉ³γ
| Models | β TMMLU+ (ACC) | CMMLU (ACC) | MMLU (ACC) | |
|---|---|---|---|---|
| TC, Knowledge | CN, Knowledge | EN, Knowledge | ||
| 5 shot | 5 shot | 5 shot | ||
| Yi-6B | 6B | 49.63 | 75.53 | 65.35 |
| Qwen-7B | 7B | 42.84 | 73.1 | 61.00 |
| Meta-Llama-3-8B | 8B | 41.97 | 50.8 | 65.17 |
| p208p2002/llama-3-zhtw-8B | 8B | 41.84 | 50.6 | 65.31 |
| Breeze-7B-Base-v0_1 | 7B | 40.35 | 44.05 | 61.63 |
| hfl/llama-3-chinese-8b | 8B | 39.64 | 50.9 | 61.1 |
| Dataset | Lang | Weight |
|---|---|---|
| FineWeb | en | 0.35 |
| Wudao | zh-cn | 0.1 |
| C4Tw | zh-tw | 0.1 |
| WikiZhTw | zh-tw | 0.15 |
| NdltdT10 | zh-tw | 0.1 |
| GitHubMarkDown | code | 0.1 |
| GitHubPython | code | 0.1 |