Text Generation
Transformers
Safetensors
ernie4_5
llama-factory
full
Generated from Trainer
conversational
Instructions to use mhtccc/ernie-4-5-0.3B-finance-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mhtccc/ernie-4-5-0.3B-finance-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mhtccc/ernie-4-5-0.3B-finance-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mhtccc/ernie-4-5-0.3B-finance-sft") model = AutoModelForCausalLM.from_pretrained("mhtccc/ernie-4-5-0.3B-finance-sft") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mhtccc/ernie-4-5-0.3B-finance-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mhtccc/ernie-4-5-0.3B-finance-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mhtccc/ernie-4-5-0.3B-finance-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mhtccc/ernie-4-5-0.3B-finance-sft
- SGLang
How to use mhtccc/ernie-4-5-0.3B-finance-sft 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 "mhtccc/ernie-4-5-0.3B-finance-sft" \ --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": "mhtccc/ernie-4-5-0.3B-finance-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mhtccc/ernie-4-5-0.3B-finance-sft" \ --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": "mhtccc/ernie-4-5-0.3B-finance-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mhtccc/ernie-4-5-0.3B-finance-sft with Docker Model Runner:
docker model run hf.co/mhtccc/ernie-4-5-0.3B-finance-sft
finance-sentiment
This model is a fine-tuned version of D:/code/LLaMA-Factory/0.my_code/process/ernie-sentiment-init on the finance_sentiment dataset. It achieves the following results on the evaluation set:
- Loss: 0.4226
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.1
- lr_scheduler_warmup_steps: 50
- num_epochs: 5
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.5518 | 0.1 | 250 | 0.5404 |
| 0.6025 | 0.2 | 500 | 0.5480 |
| 0.6125 | 0.3 | 750 | 0.5375 |
| 0.5424 | 0.4 | 1000 | 0.5382 |
| 0.5393 | 0.5 | 1250 | 0.5357 |
| 0.5091 | 0.6 | 1500 | 0.5414 |
| 0.5425 | 0.7 | 1750 | 0.5335 |
| 0.4942 | 0.8 | 2000 | 0.5646 |
| 0.5687 | 0.9 | 2250 | 0.5381 |
| 0.5462 | 1.0 | 2500 | 0.5609 |
| 0.5048 | 1.1 | 2750 | 0.4820 |
| 0.5025 | 1.2 | 3000 | 0.4848 |
| 0.4823 | 1.3 | 3250 | 0.4895 |
| 0.4914 | 1.4 | 3500 | 0.4482 |
| 0.4051 | 1.5 | 3750 | 0.4579 |
| 0.3931 | 1.6 | 4000 | 0.4225 |
| 0.3865 | 1.7 | 4250 | 0.4917 |
| 0.625 | 1.8 | 4500 | 0.4107 |
| 0.3882 | 1.9 | 4750 | 0.4676 |
| 0.2762 | 2.0 | 5000 | 0.4387 |
| 0.4132 | 2.1 | 5250 | 0.4282 |
| 0.527 | 2.2 | 5500 | 0.4122 |
| 0.4196 | 2.3 | 5750 | 0.3563 |
| 0.3263 | 2.4 | 6000 | 0.3680 |
| 0.354 | 2.5 | 6250 | 0.3632 |
| 0.4371 | 2.6 | 6500 | 0.3458 |
| 0.3613 | 2.7 | 6750 | 0.3582 |
| 0.3223 | 2.8 | 7000 | 0.3965 |
| 0.4591 | 2.9 | 7250 | 0.3279 |
| 0.4607 | 3.0 | 7500 | 0.3537 |
| 0.1142 | 3.1 | 7750 | 0.3854 |
| 0.4335 | 3.2 | 8000 | 0.3537 |
| 0.4776 | 3.3 | 8250 | 0.4166 |
| 0.3446 | 3.4 | 8500 | 0.3924 |
| 0.0918 | 3.5 | 8750 | 0.4337 |
| 0.3786 | 3.6 | 9000 | 0.4035 |
| 0.3945 | 3.7 | 9250 | 0.3965 |
| 0.1989 | 3.8 | 9500 | 0.4014 |
| 0.3032 | 3.9 | 9750 | 0.3335 |
| 0.2882 | 4.0 | 10000 | 0.3608 |
| 0.3639 | 4.1 | 10250 | 0.4448 |
| 0.283 | 4.2 | 10500 | 0.4376 |
| 0.2759 | 4.3 | 10750 | 0.4415 |
| 0.4924 | 4.4 | 11000 | 0.4275 |
| 0.3681 | 4.5 | 11250 | 0.4300 |
| 0.2862 | 4.6 | 11500 | 0.4283 |
| 0.2423 | 4.7 | 11750 | 0.4243 |
| 0.0904 | 4.8 | 12000 | 0.4217 |
| 0.2766 | 4.9 | 12250 | 0.4226 |
| 0.3408 | 5.0 | 12500 | 0.4226 |
Framework versions
- Transformers 4.57.3
- Pytorch 2.7.1+cu126
- Datasets 4.0.0
- Tokenizers 0.22.1
- Downloads last month
- 4
Model tree for mhtccc/ernie-4-5-0.3B-finance-sft
Base model
baidu/ERNIE-4.5-0.3B-PT