Update README
Browse filesadd system prompt
README.md
CHANGED
|
@@ -70,16 +70,13 @@ processor = AutoProcessor.from_pretrained(model_name_or_path, use_fast=False)
|
|
| 70 |
img_path = "path/to/your/image.jpg"
|
| 71 |
image_inputs = Image.open(img_path)
|
| 72 |
messages1 = [
|
|
|
|
| 73 |
{
|
| 74 |
"role": "user",
|
| 75 |
"content": [
|
| 76 |
{"type": "image", "image": img_path},
|
| 77 |
{"type": "text", "text": (
|
| 78 |
-
"
|
| 79 |
-
"and represent it in markdown format, ignoring headers and footers. "
|
| 80 |
-
"Tables should be expressed in HTML format, formulas in the document "
|
| 81 |
-
"should be represented using LaTeX format, and the parsing should be "
|
| 82 |
-
"organized according to the reading order."
|
| 83 |
)},
|
| 84 |
],
|
| 85 |
}
|
|
@@ -183,9 +180,10 @@ sampling_params = SamplingParams(temperature=0, max_tokens=16384)
|
|
| 183 |
img_path = "/path/to/image.jpg"
|
| 184 |
img = Image.open(img_path)
|
| 185 |
messages = [
|
|
|
|
| 186 |
{"role": "user", "content": [
|
| 187 |
{"type": "image", "image": img_path},
|
| 188 |
-
{"type": "text", "text": "
|
| 189 |
]}
|
| 190 |
]
|
| 191 |
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
|
|
|
| 70 |
img_path = "path/to/your/image.jpg"
|
| 71 |
image_inputs = Image.open(img_path)
|
| 72 |
messages1 = [
|
| 73 |
+
{"role": "system", "content": ""},
|
| 74 |
{
|
| 75 |
"role": "user",
|
| 76 |
"content": [
|
| 77 |
{"type": "image", "image": img_path},
|
| 78 |
{"type": "text", "text": (
|
| 79 |
+
"检测并识别图片中的文字,将文本坐标格式化输出。"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
)},
|
| 81 |
],
|
| 82 |
}
|
|
|
|
| 180 |
img_path = "/path/to/image.jpg"
|
| 181 |
img = Image.open(img_path)
|
| 182 |
messages = [
|
| 183 |
+
{"role": "system", "content": ""},
|
| 184 |
{"role": "user", "content": [
|
| 185 |
{"type": "image", "image": img_path},
|
| 186 |
+
{"type": "text", "text": "检测并识别图片中的文字,将文本坐标格式化输出。"}
|
| 187 |
]}
|
| 188 |
]
|
| 189 |
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|