Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

kacperwikiel
/
RysOCR

Image-Text-to-Text
PEFT
Safetensors
Transformers
Polish
ocr
lora
polish
document-ai
vision-language
conversational
Model card Files Files and versions
xet
Community

Instructions to use kacperwikiel/RysOCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • PEFT

    How to use kacperwikiel/RysOCR with PEFT:

    from peft import PeftModel
    from transformers import AutoModelForCausalLM
    
    base_model = AutoModelForCausalLM.from_pretrained("PaddlePaddle/PaddleOCR-VL")
    model = PeftModel.from_pretrained(base_model, "kacperwikiel/RysOCR")
  • Transformers

    How to use kacperwikiel/RysOCR with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="kacperwikiel/RysOCR")
    messages = [
        {
            "role": "user",
            "content": [
                {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
                {"type": "text", "text": "What animal is on the candy?"}
            ]
        },
    ]
    pipe(text=messages)
    # Load model directly
    from transformers import AutoModel
    model = AutoModel.from_pretrained("kacperwikiel/RysOCR", dtype="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use kacperwikiel/RysOCR with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "kacperwikiel/RysOCR"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/chat/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "kacperwikiel/RysOCR",
    		"messages": [
    			{
    				"role": "user",
    				"content": [
    					{
    						"type": "text",
    						"text": "Describe this image in one sentence."
    					},
    					{
    						"type": "image_url",
    						"image_url": {
    							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
    						}
    					}
    				]
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/kacperwikiel/RysOCR
  • SGLang

    How to use kacperwikiel/RysOCR 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 "kacperwikiel/RysOCR" \
        --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": "kacperwikiel/RysOCR",
    		"messages": [
    			{
    				"role": "user",
    				"content": [
    					{
    						"type": "text",
    						"text": "Describe this image in one sentence."
    					},
    					{
    						"type": "image_url",
    						"image_url": {
    							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
    						}
    					}
    				]
    			}
    		]
    	}'
    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 "kacperwikiel/RysOCR" \
            --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": "kacperwikiel/RysOCR",
    		"messages": [
    			{
    				"role": "user",
    				"content": [
    					{
    						"type": "text",
    						"text": "Describe this image in one sentence."
    					},
    					{
    						"type": "image_url",
    						"image_url": {
    							"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
    						}
    					}
    				]
    			}
    		]
    	}'
  • Docker Model Runner

    How to use kacperwikiel/RysOCR with Docker Model Runner:

    docker model run hf.co/kacperwikiel/RysOCR
RysOCR
35.1 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 9 commits
anon
Update README.md
36b9aa5 verified 4 months ago
  • .gitattributes
    1.57 kB
    Upload folder using huggingface_hub 4 months ago
  • README.md
    3.52 kB
    Update README.md 4 months ago
  • adapter_config.json
    1.01 kB
    Upload folder using huggingface_hub 4 months ago
  • adapter_model.safetensors
    22 MB
    xet
    Upload folder using huggingface_hub 4 months ago
  • added_tokens.json
    25.4 kB
    Upload folder using huggingface_hub 4 months ago
  • chat_template.jinja
    1.47 kB
    Upload folder using huggingface_hub 4 months ago
  • image_processing_paddleocr_vl.py
    25 kB
    Upload folder using huggingface_hub 4 months ago
  • preprocessor_config.json
    710 Bytes
    Upload folder using huggingface_hub 4 months ago
  • processing_paddleocr_vl.py
    12.3 kB
    Upload folder using huggingface_hub 4 months ago
  • processor_config.json
    137 Bytes
    Upload folder using huggingface_hub 4 months ago
  • special_tokens_map.json
    1.15 kB
    Upload folder using huggingface_hub 4 months ago
  • tokenizer.json
    11.2 MB
    xet
    Upload folder using huggingface_hub 4 months ago
  • tokenizer.model
    1.61 MB
    xet
    Upload folder using huggingface_hub 4 months ago
  • tokenizer_config.json
    186 kB
    Upload folder using huggingface_hub 4 months ago