Downloads · 30 days
53
8% of all-time downloads
anyforge/Flame-OCR-gguf
Flame-OCR-gguf is a image-text-to-text model from anyforge. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
<p align="center" <a href="https://www.modelscope.cn/models/anyforge/Flame-OCR" target="blank"<img alt="Static Badge" src="https://img.shields.io/badge/%E9%AD%94%E6%90%AD-ModelScope-blue"</a <a href="https://huggingfa…
Downloads · 30 days
53
8% of all-time downloads
All-time downloads
652
Public
Repo size
1.7 GB
Likes
1
Public
Click a slice to open those files.
.gguf1.7 GB · 100%
From the Hugging Face model README
convert by unsloth
llama.cpp server
llama-server \
-m ./flame-ocr/flame-ocr.BF16.gguf \
--mmproj ./flame-ocr/flame-ocr.BF16-mmproj.gguf \
--port 18003 \
--host 0.0.0.0 \
--temp 0 \
--alias "flame-ocr" \
--api-key "sk-123456"
ollama run AnyForge/flame-ocr:latest
import base64
from openai import OpenAI
def image_to_base64(image_path: str) -> str:
with open(image_path, "rb") as f:
return base64.b64encode(f.read()).decode("utf-8")
client = OpenAI(
base_url="http://localhost:18003/v1",
api_key="sk-123456"
)
image_path = "/path/to/image.png"
base64_image = image_to_base64(image_path)
prompt = '\nExtract all readable content from the image in natural human reading order and output the result as a single Markdown document. For charts or images, represent them using an HTML image tag: <' + 'img src="images/bbox_{left}_{top}_{right}_{bottom}.jpg" />, where left, top, right, bottom are bounding box coordinates scaled to [0, 1000). Format formulas as LaTeX. Format tables as HTML: <table>...</table>. Transcribe all other text as standard Markdown. Preserve the original text without translation or paraphrasing.'
response = client.chat.completions.create(
model="flame-ocr",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": f"data:image/png;base64,{base64_image}"
}
},
{
"type": "text",
"text": prompt
}
]
}
],
max_tokens=8192,
temperature=0.0,
extra_body={
"mm_processor_kwargs": {
"images_kwargs": {
"min_pixels": 448 * 448,
"max_pixels": 2880 * 2880
}
}
}
)
print(response.choices[0].message.content)