I definitely think the error is occurring with the line
label = “Enter a weibo id between 0 and " + str(max_num_weibos - 1) + " to find similar weibos:”
Have you replaced it with a simple string to confirm?
label = 'A plain string, just to test my variable is not having problems rendering as a string'
No I have no I can try
Also, looks like your code is locally pointing to model files, so I can’t run the code. Sorry.
I can share them if needed
If you’d like me to take a look… I did spin up a complete virtual environment to test out your code, so as long as I’m here…
Yeah glad to bc I am really getting desperate here lol
I can add the excel files to my github
Files have been uploaded to my github
Still missing an excel file: freeweibo-09-15-2022.xlsx
oh sorry one sec
done
Looks like it isn’t encoded in utf-8…do you know what codec you used or better yet can you re-save it with utf-8?
which file?
re-saved the the freeweibo file as UTF-8
I don’t think that is as much an issue since wouldn’t be more import to identify the code that is breaking the whole thing? Unless not having the right character set wont allow you to go further.
The trouble is that the code breaks repeatedly because there aren’t checks to make sure it is working on non-empty results at each step. I can play a little to see if I can get it to go to the end and find out if it still errors, but that puts me at quite a deviation from how the code is executing for you…
ok I am trying to troubleshoot as well.
OK so I may have found the error I got this error for this line of code.
weibo_input = st.number_input(label, 0, max_num_weibos-1, value=0, step=1, key=‘weibo_input’)
I got this error.
StreamlitAPIException : The default value
of 0 must lie between the min_value
of 0 and the max_value
of -1, inclusively.