Alexandre-Numind commited on
Commit
c5f6c23
·
verified ·
1 Parent(s): 8fdf1af

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -9
README.md CHANGED
@@ -194,15 +194,20 @@ base64_image = encode_image("invoice.png")
194
 
195
  chat_response = client.chat.completions.create(
196
  model="numind/NuMarkdown-8B-reasoning",
197
- temperature=0.8,
198
  messages=[
199
- {
200
- "role": "user",
201
- "content": [
202
- {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{base64_image}"}},
 
 
 
 
 
 
203
  ],
204
- },
205
- ]
206
  )
207
 
208
  reasoning = chat_response.choices[0].message.content.split("<thining>")[1].split("</thining>")[0]
@@ -222,7 +227,8 @@ model_id = "numind/NuMarkdown-8B-reasoning"
222
 
223
  processor = AutoProcessor.from_pretrained(
224
  model_id,
225
- trust_remote_code=True,
 
226
  )
227
 
228
  model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
@@ -244,7 +250,7 @@ prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_
244
  enc = processor(text=prompt, images=[img], return_tensors="pt").to(model.device)
245
 
246
  with torch.no_grad():
247
- out = model.generate(**enc, max_new_tokens=5000)
248
 
249
  print(processor.decode(out[0].split("<answer>")[1].split("</answer>")[0], skip_special_tokens=True))
250
  ```
 
194
 
195
  chat_response = client.chat.completions.create(
196
  model="numind/NuMarkdown-8B-reasoning",
197
+ temperature=0.7,
198
  messages=[
199
+ {
200
+ "role": "user",
201
+ "content": [
202
+ {"type": "image_url",
203
+ "image_url": {"url": data_url},
204
+ "min_pixels": 100 * 28 * 28,
205
+ "max_pixels": 5000 * 28 * 28,},
206
+
207
+ ],
208
+ },
209
  ],
210
+
 
211
  )
212
 
213
  reasoning = chat_response.choices[0].message.content.split("<thining>")[1].split("</thining>")[0]
 
227
 
228
  processor = AutoProcessor.from_pretrained(
229
  model_id,
230
+ trust_remote_code=True,
231
+ min_pixels=100*28*28, max_pixels=5000*28*28
232
  )
233
 
234
  model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
 
250
  enc = processor(text=prompt, images=[img], return_tensors="pt").to(model.device)
251
 
252
  with torch.no_grad():
253
+ out = model.generate(**enc, temperature = 0.7, max_new_tokens=5000)
254
 
255
  print(processor.decode(out[0].split("<answer>")[1].split("</answer>")[0], skip_special_tokens=True))
256
  ```