[GH-ISSUE #318] Enhance flexibility for accepted tag format #209

Closed
opened 2026-03-02 11:47:38 +03:00 by kerem · 5 comments
Owner

Originally created by @Jason-233 on GitHub (Jul 21, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/318

im currently using qwen1.5-14b-chat-awq and glm-4v for inference.
i got these three responses in a row for a picture inference with glm-4v, and i wondered if it was possible that hoarder would take these responses too. sometimes, the same response happened on qwen1.5-14b-chat-awq.
i really appreciate your work.
below are the logs of the responses.

hoarder-workers-1      | 2024-07-21T15:12:39.893Z error: [inference][1612] inference job failed: Error: [inference][1612] The model ignored our prompt and didn't respond with the expected JSON: {}. Here's a sneak peak from the response: ```json
hoarder-workers-1      | {
hoarder-workers-1      |   "tags": 
hoarder-workers-1      | 2024-07-21T15:12:40.435Z info: [inference][1612] Starting an inference job for bookmark with id "iwrg9lg8vf7te4sf8cvf4z28"
hoarder-workers-1      | 2024-07-21T15:12:47.826Z error: [inference][1612] inference job failed: Error: [inference][1612] The model ignored our prompt and didn't respond with the expected JSON: {}. Here's a sneak peak from the response: ```json
hoarder-workers-1      | {
hoarder-workers-1      |   "tags": 
hoarder-workers-1      | 2024-07-21T15:12:48.870Z info: [inference][1612] Starting an inference job for bookmark with id "iwrg9lg8vf7te4sf8cvf4z28"
hoarder-workers-1      | 2024-07-21T15:12:53.630Z error: [inference][1612] inference job failed: Error: [inference][1612] The model ignored our prompt and didn't respond with the expected JSON: {}. Here's a sneak peak from the response: ```json
hoarder-workers-1      | {
hoarder-workers-1      |   "tags": 

Here's a sneak peak from the response: ```json
hoarder-workers-1 | {
hoarder-workers-1 | "tags":

Originally created by @Jason-233 on GitHub (Jul 21, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/318 im currently using qwen1.5-14b-chat-awq and glm-4v for inference. i got these three responses in a row for a picture inference with glm-4v, and i wondered if it was possible that hoarder would take these responses too. sometimes, the same response happened on qwen1.5-14b-chat-awq. i really appreciate your work. below are the logs of the responses. ``` hoarder-workers-1 | 2024-07-21T15:12:39.893Z error: [inference][1612] inference job failed: Error: [inference][1612] The model ignored our prompt and didn't respond with the expected JSON: {}. Here's a sneak peak from the response: ```json hoarder-workers-1 | { hoarder-workers-1 | "tags": hoarder-workers-1 | 2024-07-21T15:12:40.435Z info: [inference][1612] Starting an inference job for bookmark with id "iwrg9lg8vf7te4sf8cvf4z28" hoarder-workers-1 | 2024-07-21T15:12:47.826Z error: [inference][1612] inference job failed: Error: [inference][1612] The model ignored our prompt and didn't respond with the expected JSON: {}. Here's a sneak peak from the response: ```json hoarder-workers-1 | { hoarder-workers-1 | "tags": hoarder-workers-1 | 2024-07-21T15:12:48.870Z info: [inference][1612] Starting an inference job for bookmark with id "iwrg9lg8vf7te4sf8cvf4z28" hoarder-workers-1 | 2024-07-21T15:12:53.630Z error: [inference][1612] inference job failed: Error: [inference][1612] The model ignored our prompt and didn't respond with the expected JSON: {}. Here's a sneak peak from the response: ```json hoarder-workers-1 | { hoarder-workers-1 | "tags": ``` Here's a sneak peak from the response: ```json hoarder-workers-1 | { hoarder-workers-1 | "tags":
kerem closed this issue 2026-03-02 11:47:38 +03:00
Author
Owner

@kamtschatka commented on GitHub (Jul 21, 2024):

I don't understand what you mean? There is no data in this response, what would you expect to use here?

<!-- gh-comment-id:2241693544 --> @kamtschatka commented on GitHub (Jul 21, 2024): I don't understand what you mean? There is no data in this response, what would you expect to use here?
Author
Owner

@Jason-233 commented on GitHub (Jul 21, 2024):

Sorry, i thought that the reponse started with ```json , so it was ignored as not being the appropriate format.
then i took a further look at the response.
that cannot be resolved, right?

{ "tags": [ "天际未来科技有限公司", "Top 10客户名单", "排名", "排名变化", "企业名称", "市值(亿人民币)", "价值变化", "城市", "行业", "Infinity Innovations Inc.", "13800", "-3000", "洛杉矶", "金融科技" ], ... // Additional tags based on the content of the image }
<!-- gh-comment-id:2241705625 --> @Jason-233 commented on GitHub (Jul 21, 2024): Sorry, i thought that the reponse started with ```json , so it was ignored as not being the appropriate format. then i took a further look at the response. that cannot be resolved, right? ``` { "tags": [ "天际未来科技有限公司", "Top 10客户名单", "排名", "排名变化", "企业名称", "市值(亿人民币)", "价值变化", "城市", "行业", "Infinity Innovations Inc.", "13800", "-3000", "洛杉矶", "金融科技" ], ... // Additional tags based on the content of the image } ```
Author
Owner

@MohamedBassem commented on GitHub (Jul 21, 2024):

@Jason-233 In the prompt for images, we have Don't wrap the response in a markdown code. which I added explicitly to ask the model to not add this wrapping. I think we can probably add it in the prompt for text as well.

<!-- gh-comment-id:2241709600 --> @MohamedBassem commented on GitHub (Jul 21, 2024): @Jason-233 In the prompt for images, we have `Don't wrap the response in a markdown code.` which I added explicitly to ask the model to not add this wrapping. I think we can probably add it in the prompt for text as well.
Author
Owner

@Jason-233 commented on GitHub (Jul 21, 2024):

@Jason-233 In the prompt for images, we have Don't wrap the response in a markdown code. which I added explicitly to ask the model to not add this wrapping. I think we can probably add it in the prompt for text as well.

@MohamedBassem
thanks for your explaining.
glm-4v,vision model i used for picture inference, just kept adding this wrapping. so that means i need a new vision model, right? or extract json from the markdown code?

<!-- gh-comment-id:2241711248 --> @Jason-233 commented on GitHub (Jul 21, 2024): > @Jason-233 In the prompt for images, we have `Don't wrap the response in a markdown code.` which I added explicitly to ask the model to not add this wrapping. I think we can probably add it in the prompt for text as well. @MohamedBassem thanks for your explaining. glm-4v,vision model i used for picture inference, just kept adding this wrapping. so that means i need a new vision model, right? or extract json from the markdown code?
Author
Owner

@MohamedBassem commented on GitHub (Jul 21, 2024):

@Jason-233 yeah, if the model is ignoring the prompt, I'm not a big fan of explicitly handling the markdown to be honest. Can you try llava for example for the picture inference?

<!-- gh-comment-id:2241713725 --> @MohamedBassem commented on GitHub (Jul 21, 2024): @Jason-233 yeah, if the model is ignoring the prompt, I'm not a big fan of explicitly handling the markdown to be honest. Can you try `llava` for example for the picture inference?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#209
No description provided.