Instructions to use vastai-ais/GLM-OCR-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vastai-ais/GLM-OCR-FP8 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="vastai-ais/GLM-OCR-FP8")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("vastai-ais/GLM-OCR-FP8") model = AutoModelForMultimodalLM.from_pretrained("vastai-ais/GLM-OCR-FP8", device_map="auto") - Notebooks
- Google Colab
- Kaggle
GLM-OCR-FP8
Model Details
This model is a FP8 model with group_size 128 of zai-org/GLM-OCR generated by vastai modelzoo. Please follow the license of the original model.
vllm Inference
- vllm >= v0.17.0
- VVI >= 26.04
vllm serve vastai-ais/GLM-OCR-FP8 --served-model-name glm-ocr --max-model-len 16384
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "glm-ocr",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "请帮我提取图片中的所有文字,并按原始排版输出。"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.bigmodel.cn/static/logo/introduction.png"
}
}
]
}
],
"max_tokens": 4096
}'
- Downloads last month
- 11