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

"statusCode":500 #19

Open
ECEAthipanbose opened this issue Nov 21, 2024 · 1 comment
Open

"statusCode":500 #19

ECEAthipanbose opened this issue Nov 21, 2024 · 1 comment

Comments

@ECEAthipanbose
Copy link

ECEAthipanbose commented Nov 21, 2024

curl 'localhost:8008/message?message=what%20is%20the%20advantage%20of%20rust%20over%20c&name=a%20curious%20explorer'

i got error like this
{"statusCode":500,"error":"Internal Server Error","message":"Cannot read properties of undefined (reading 'numTokens')"}(base)

I encountered an issue in the prompt preview. While I was able to see the sample prompt in the preview, testing it using 'Submit' to GPT-3.5 or GPT-4 resulted in an error alert stating, 'Failed to fetch (localhost:628... says,).'

@johnstew
Copy link

FWIW, I'm getting the same thing locally as well. It looks like the error is coming from within the library itself.

TypeError: Cannot read properties of undefined (reading 'numTokens')
    at numTokensPromptString (/Users/John/Dev/priompt/priompt/dist/lib.js:2452:22)
    at countMsgTokens (/Users/John/Dev/priompt/priompt/dist/lib.js:2817:31)
    at /Users/John/Dev/priompt/priompt/dist/lib.js:2513:72
    at Array.map (<anonymous>)
    at countTokensExact (/Users/John/Dev/priompt/priompt/dist/lib.js:2513:61)
    at renderBinarySearch (/Users/John/Dev/priompt/priompt/dist/lib.js:831:30)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at render (/Users/John/Dev/priompt/priompt/dist/lib.js:478:12)
    at renderun (/Users/John/Dev/priompt/priompt/dist/lib.js:534:20)
    at Object.<anonymous> (/Users/John/Dev/priompt/examples/src/index.ts:125:19)

I'm trying to dig into this more but will have to come back.

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