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

[BUG] syntaxerror: Unexpected token 'F', Failed is not valid JSON #361

Closed
simsherpa opened this issue Jun 18, 2023 · 6 comments
Closed

[BUG] syntaxerror: Unexpected token 'F', Failed is not valid JSON #361

simsherpa opened this issue Jun 18, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@simsherpa
Copy link

Describe the bug
Thank you so much for this very inspired resource!

I am encountering the following error with the flow below:

SyntaxError: Unexpected token 'F', "Failed to "... is not valid JSON
at JSON.parse ()
at parseJSONFromBytes (node:internal/deps/undici/undici:6613:19)
at successSteps (node:internal/deps/undici/undici:6587:27)
at node:internal/deps/undici/undici:1236:60
at node:internal/process/task_queues:140:7
at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
attemptNumber: 7,
retriesLeft: 0
}

To Reproduce
Steps to reproduce the behavior:

  1. Copy Conversational Retrieval QA Chain flow from Marketplace
  2. Replace Text File component with PDF File component
  3. Replace OpenAI components with HuggingFace component
  4. Enter API Keys
  5. Save flow
  6. Select PDF
  7. Enter Prompt in Chat panel

Expected behavior
A clear and concise description of what you expected to happen.

Expected the flow to execute allowing inspection of PDF file entries.

Screenshots
If applicable, add screenshots to help explain your problem.

image

Flow
If applicable, add exported flow in order to help replicating the problem.
PDF-Explorer Chatflow.zip

Setup

  • Installation: npx flowise start
  • Flowise Version: 1.2.11
  • OS: macOS (Sonoma)
  • Browser: Arc/chrome

Additional context
Add any other context about the problem here.

@simsherpa simsherpa changed the title [BUG] [BUG] syntaxerror: Unexpected token 'F', Failed is not valid JSON Jun 18, 2023
@HenryHengZJ
Copy link
Contributor

hey @simsherpa do you face same problem when using ChatOpenAI and OpenAIEmbedding nodes?

@HenryHengZJ HenryHengZJ added the bug Something isn't working label Jun 19, 2023
@simsherpa
Copy link
Author

Hi @HenryHengZJ, thanks for the follow-up. I'm exploring strictly open source LLMs -- so I do not have an OpenAI account and therefore have not tried those OpenAI components. Any other suggestions?

@trepont
Copy link

trepont commented Jul 4, 2023

hey @simsherpa do you face same problem when using ChatOpenAI and OpenAIEmbedding nodes?

Hey, @HenryHengZJ, it was functioning properly when utilizing the ChatOpenAI and OpenAIEmbedding nodes. However, we are currently seeking an open-source language model like LLM-Falcon. Could you please investigate this matter?

@raffareis
Copy link
Contributor

I have this same problem in two different flows. Both uing ChatOpenAi. The common characteristic is that it is a LLM Chain feeding an OutPut prediction into an Prompt Template, and the LLM Chain outputs predictions that contains "

Seems like the " character is not being escaped, and thus it is breaking the json.

image

image

@HenryHengZJ
Copy link
Contributor

good news we have a PR addressing this issue - #558

@raffareis
Copy link
Contributor

Update: The former PR got closed, now on #612

JohnBQuinn pushed a commit to JohnBQuinn/Flowise that referenced this issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants