Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected model output #331

Open
xy3xy3 opened this issue Feb 19, 2025 · 2 comments
Open

Unexpected model output #331

xy3xy3 opened this issue Feb 19, 2025 · 2 comments

Comments

@xy3xy3
Copy link

xy3xy3 commented Feb 19, 2025

I met some error when using this tool.
It seems that the large model does not strictly follow the JSON output, but uses natural language.
When I use gpt-4o-mini

Processing file 1/15
Processing file 2/15
Processing: 100%
Processing file 3/15
Processing file 4/15
undefined:1
```javascript
^

SyntaxError: Unexpected token '`', "```javascr"... is not valid JSON
    at JSON.parse (<anonymous>)
    at file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55223:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async visitAllIdentifiers (file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55082:21)
    at async file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55210:12     
    at async unminify (file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:172:27)
    at async Command.<anonymous> (file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55292:3)

Node.js v20.16.0

When I use gpt-4o

Processing file 1/15
Processing file 2/15
Processing: 100%
Processing file 3/15
Processing file 4/15
undefined:1
To give the variable `t` a more descriptive name based on its usage, we need to understand its function in the code. In this snippet, `t` seems to be a function that is invoked with the parameters `this`, `"small"`, `""`, and `""`. It is likely a handler or function that processes these parameters.
^

SyntaxError: Unexpected token 'T', "To give th"... is not valid JSON
    at JSON.parse (<anonymous>)
    at file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55223:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async visitAllIdentifiers (file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55082:21)
    at async file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55210:12     
    at async unminify (file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:172:27)
    at async Command.<anonymous> (file:///C:/Users/12018/AppData/Local/pnpm/global/5/.pnpm/[email protected]/node_modules/humanifyjs/dist/index.mjs:55292:3)

Node.js v20.16.0
@xy3xy3
Copy link
Author

xy3xy3 commented Feb 19, 2025

It may be caused by the reverse openai interface used by the third-party transit API I use. Now I have changed one, which seems to be normal.

@jehna
Copy link
Owner

jehna commented Feb 19, 2025

It may be caused by the reverse openai interface used by the third-party transit API I use

Might make sense. A proxy is fine as long as it supports the json_schema mode output that forces a json specific output, but it might be that yours does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants