OCR
Collection
6 items • Updated
How to use fklska/trocr_latex with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="fklska/trocr_latex") # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("fklska/trocr_latex")
model = AutoModelForMultimodalLM.from_pretrained("fklska/trocr_latex")How to use fklska/trocr_latex with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "fklska/trocr_latex"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "fklska/trocr_latex",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/fklska/trocr_latex
How to use fklska/trocr_latex with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "fklska/trocr_latex" \
--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": "fklska/trocr_latex",
"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 "fklska/trocr_latex" \
--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": "fklska/trocr_latex",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use fklska/trocr_latex with Docker Model Runner:
docker model run hf.co/fklska/trocr_latex
This model is a fine-tuned version of microsoft/trocr-base-handwritten on an unknown dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.7512 | 0.2146 | 300 | 1.3183 |
| 0.8624 | 0.4292 | 600 | 0.6592 |
| 0.4766 | 0.6438 | 900 | 0.4673 |
| 0.3025 | 0.8584 | 1200 | 0.3693 |
| 0.2046 | 1.0730 | 1500 | 0.2941 |
Base model
microsoft/trocr-base-handwritten