TrevorJS/check-amount-verbalizer-synthetic-data
Viewer • Updated • 130k • 18
How to use TrevorJS/check-amount-deverbalizer-smollm2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="TrevorJS/check-amount-deverbalizer-smollm2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("TrevorJS/check-amount-deverbalizer-smollm2")
model = AutoModelForCausalLM.from_pretrained("TrevorJS/check-amount-deverbalizer-smollm2")
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 TrevorJS/check-amount-deverbalizer-smollm2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "TrevorJS/check-amount-deverbalizer-smollm2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "TrevorJS/check-amount-deverbalizer-smollm2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/TrevorJS/check-amount-deverbalizer-smollm2
How to use TrevorJS/check-amount-deverbalizer-smollm2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "TrevorJS/check-amount-deverbalizer-smollm2" \
--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": "TrevorJS/check-amount-deverbalizer-smollm2",
"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 "TrevorJS/check-amount-deverbalizer-smollm2" \
--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": "TrevorJS/check-amount-deverbalizer-smollm2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use TrevorJS/check-amount-deverbalizer-smollm2 with Docker Model Runner:
docker model run hf.co/TrevorJS/check-amount-deverbalizer-smollm2
This model is a fine-tuned version of HuggingFaceTB/SmolLM2-135M-Instruct on an unknown dataset. It achieves the following results on the evaluation set:
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Json Parse Rate | Dollar Accuracy | Cents Accuracy | Digit Count Accuracy | Perfect Match |
|---|---|---|---|---|---|---|---|---|
| 0.1588 | 0.2128 | 200 | 0.1580 | 0.9571 | 0.9271 | 0.9529 | 0.95 | 0.9186 |
| 0.1576 | 0.4255 | 400 | 0.1549 | 0.96 | 0.9557 | 0.96 | 0.96 | 0.9557 |
| 0.1546 | 0.6383 | 600 | 0.1539 | 0.96 | 0.9571 | 0.96 | 0.96 | 0.9571 |
| 0.154 | 0.8511 | 800 | 0.1541 | 0.9586 | 0.95 | 0.9586 | 0.9586 | 0.95 |
| 0.1539 | 1.0638 | 1000 | 0.1536 | 0.96 | 0.9557 | 0.96 | 0.96 | 0.9557 |
| 0.1544 | 1.2766 | 1200 | 0.1524 | 0.96 | 0.96 | 0.96 | 0.96 | 0.96 |
| 0.1535 | 1.4894 | 1400 | 0.1529 | 0.96 | 0.9571 | 0.96 | 0.96 | 0.9571 |
| 0.1537 | 1.7021 | 1600 | 0.1525 | 0.96 | 0.9586 | 0.96 | 0.96 | 0.9586 |
| 0.1548 | 1.9149 | 1800 | 0.1527 | 0.96 | 0.9586 | 0.96 | 0.96 | 0.9586 |
| 0.1545 | 2.1277 | 2000 | 0.1524 | 0.96 | 0.96 | 0.96 | 0.96 | 0.96 |
| 0.1534 | 2.3404 | 2200 | 0.1526 | 0.96 | 0.96 | 0.96 | 0.96 | 0.96 |
| 0.1533 | 2.5532 | 2400 | 0.1522 | 0.96 | 0.96 | 0.96 | 0.96 | 0.96 |
| 0.1524 | 2.7660 | 2600 | 0.1521 | 0.96 | 0.96 | 0.96 | 0.96 | 0.96 |
| 0.1527 | 2.9787 | 2800 | 0.1520 | 0.96 | 0.96 | 0.96 | 0.96 | 0.96 |
Base model
HuggingFaceTB/SmolLM2-135M