Image-Text-to-Text
Transformers
Safetensors
Chinese
English
qwen2_5_vl
ocr
document-parsing
multimodal
conversational
custom_code
text-generation-inference
Instructions to use kp-forks/TeleOCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kp-forks/TeleOCR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="kp-forks/TeleOCR", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("kp-forks/TeleOCR", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("kp-forks/TeleOCR", trust_remote_code=True, device_map="auto") 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?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kp-forks/TeleOCR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kp-forks/TeleOCR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kp-forks/TeleOCR", "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/kp-forks/TeleOCR
- SGLang
How to use kp-forks/TeleOCR 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 "kp-forks/TeleOCR" \ --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": "kp-forks/TeleOCR", "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 "kp-forks/TeleOCR" \ --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": "kp-forks/TeleOCR", "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 kp-forks/TeleOCR with Docker Model Runner:
docker model run hf.co/kp-forks/TeleOCR
Commit History
15 days ago
-
Update README.md
Original commit: e92585356c0d0b7b7a65938f3da035c6593cc9a652da45d -
Update README.md
Original commit: a61433186527cb53958bf354e34ae673c19cec4bd334c3f -
Update README.md
Original commit: a06f146e795e104640ee8c813f87ca1eb334e4860fe4597 -
Update README.md
Original commit: 8706730e41382f4a8f2562616d47225fee8e2f7a257a791 -
Update README.md
Original commit: a99c4e19b0c83f2e11f45f6a579d7a0ad131e9db8e39401 -
Update README.md
Original commit: 36e402f528939d13576ac69deb66599b249e038ec71028d -
Update README.md
Original commit: 73759a2db254bee30618af0c10f7aebd4e1fa2313b899f2 -
Update README.md
Original commit: 710ea2e26d794fe89cbf3ece0402707c332a86716c56a2f -
Update README.md
Original commit: 3b8a2e87322cfceb58e163514ec2f1811a6a8eb0e30ee05 -
Update README.md
Original commit: c394c1f5d481e836aea7b8651b76d71fe3bb7dc0cdac4fa -
Update README.md
Original commit: 0de5c3c8ed398ea938188e3529ff5135f34da4969e6159d -
Update README.md
Original commit: e076e3cc32d6f20525e4ec0b26a5bbf38ed8772d922db2e -
Update README.md
Original commit: c21590c42881b75965e5345530b01e9084fe7a6e4b60f2f -
Update README.md
Original commit: c7179051a52a0a54a549388de89c6aa715cfd0afa5729aa -
Update README.md
Original commit: 09960cdd08df75b8571c8747ceee6db9eae46683040c566 -
Update README.md
Original commit: 36bd900ff42cdcdfce57a9d7f64070cb17ac9b035274b4a -
Update README.md
Original commit: f9ac890fbb009d11cc2b446394546e249d239b86e3dec7d -
Update README.md
Original commit: 807e29dffc62254f821ec5f1e8130f6145c22d724abe682 -
Update README.md
Original commit: b69608400a70f7cf5e312ee8d9b6cf585668a4fb4cf8e34 -
Update README.md
Original commit: 366fd085c0b9f368e089c165d0658ae0939d3a1c70a61a5 -
Update README.md
Original commit: e2bb158ca7b62d8efc9c38222aeceececf1df8e271f34bb -
Update README.md
Original commit: 5f1d35b85ef5e411795d3b0428e5479bc5afbdd98eb55c1 -
Update README.md
Original commit: 77ae0664ebf878dddf70f1bff4ab675f04a6eceae5769b0 -
Update README.md
Original commit: 7484ad0d4004fdfe9a66587f7d0b61b68d6f423df2627d4 -
Update README.md
Original commit: 38f1e44e0b978791363cb97f0227d32f764ed07ff35b8c9 -
Update README.md
Original commit: a273d31a45b3ab387f7951d218282bd13c860d2b07264a5 -
Update README.md
Original commit: 3742bd8e013cd48dabe2f67f6abb98a34f18ff93df747a3 -
Upload folder using huggingface_hub
Original commit: 27d763e8913cf65cd97899f613a79eff930fc6a25ba569f -
Upload folder using huggingface_hub
Original commit: d9aec254e702b5135ca5b2dd535b99f08aea6319bb36694 -
Upload folder using huggingface_hub
Original commit: 18617633bf74a2697923d1b94917433348434a93091434b -
initial commit
Original commit: 2a590a56b1f733e6fb19466c3df976af410e1a49706da2f -
Setup LFS tracking
d59cd3d