Mapping in input of API call returns an error

Hello
I am trying to setup the API call for the Huggingface module.

by running only the module woithout mapping it works, but in the whole scenario i keep getting the warning.
I think by mapping the content from a previous model, some characters get inserted which interfere with the syntax expected.
How do I fix this?

Thank you!


if its formatting error u can use toString() function and bind your input in this

3 Likes

Hello

Like this I am still getting the same error.

Screenshot 2024-02-28 at 13.58.25

Chat gpt response contain have some character may be broke json text formatting

Could be a couple things.

First, I noticed something similar when trying to use Make operators inside an input like this. This might not apply here because you weren’t using the toString the first time it happened, but it’s worth a shot.

This kind of error happened to me with formatting dates and times. When it happened to me, there was no obvious sign the input was being changed, but when received by the next module it was detecting something and quitting.

  • Try to make a dedicated module to format the text to a string first and pass the output into Huggingface.

Another thing to check is the output of the GPT module. Look for things like quotation marks. As @Pro_Tanvee mentioned, GPT can include weird stuff that breaks the formatting.

  • To solve the quotation marks from GPT issue, I set up dedicated regex replace modules to check the GPT output and replace and instance of text between " with the same text, minus ".

Try passing the text through this one first and see if it helps! :smiley:

Let me know if either of these work, please. I’m very interested in this issue. Ty!

2 Likes

Hi

I switched to another model but I keep getting json errors.

{“detail”:[{“type”:“json_invalid”,“loc”:[“body”,180],“msg”:“JSON decode error”,“input”:{},“ctx”:{“error”:“Invalid control character at”}}]}

The input looks correct to me…

I tried with toString() function and without.

1 Like

Have you ran it through a JSON validator? That’s how I caught mine.

Sorry I couldn’t help more! Keep trying, you’ll figure it out!

3 Likes

I found the error. There where some paragraphs in the input… :smirk:

3 Likes