-
Notifications
You must be signed in to change notification settings - Fork 75
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
JSONDecodeError: Extra data: line 1 column 61 (char 60) #5
Comments
Looks like it is all about token limits. When response is too long then system just cut it and response becomes not correct json structure. For example: |
Having the same issue, did manage to sort it out? Also, it's pretty slow with 10mb CSV files |
Nope, this tool outputs json structure with all data from csv and it would always hit token limit. The right way to do it is to change prompt and code so it would output pandas/matplotlib code instead and then this code is needed to be converted into pandas df/plot. |
Hey. You're absolutely right. When outputting data as a JSON structure, it's highly likely to hit the token limit. To address this, I'm experimenting with an alternative approach by outputting the data as a data frame formula. For instance, instead of returning a complete string of books with the highest rating, it will return a string like Once the string is converted to a dictionary, we can apply it to the actual DataFrame, like this: df = pd.read_csv(data)
if "table" in response_dict:
data = response_dict["table"]
table_df = eval(data["data"])
st.table(table_df) The evaluation statement eval() will process the expression, effectively converting it back into a DataFrame object. Finally, the rendered DataFrame will be displayed in Streamlit. |
Hi. I am getting the following error:
It looks like something wrong with
decode_response
function.I changed it to:
and it started working for simple questions, but it fails for most questions (e.g. plot something)
The text was updated successfully, but these errors were encountered: