Streamlit JSONDecodeError: Expecting value: line 1 column 1 (char 0)
See original GitHub issueDear @DmitryKey , it is a pleasure to follow your guides and go through the examples. Thank you for providing such interesting tools.
Concerning “Neural Search with BERT and Solr” everything seems to go alright including indexing and searching on the solr server, however, once I start streamlit the following errors occur when I search. Do you have any idea about what it may be?
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback:
File "/home/n/documents/my_jina_app/baas/env/lib/python3.6/site-packages/streamlit/script_runner.py", line 337, in _run_script
exec(code, module.__dict__)
File "/home/n/documents/my_jina_app/baas/bert-solr-search/src/search_demo_solr.py", line 122, in <module>
docs, query_time, numfound = sc.query("vector", query)
File "src/client/solr_client.py", line 102, in query
resp = resp.json()
File "/home/n/documents/my_jina_app/baas/env/lib/python3.6/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/home/n/anaconda3/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/home/n/anaconda3/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/n/anaconda3/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
Thank you for your consideration.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Got JSONDecodeError: Expecting value: line 1 column 1 (char ...
Your file is not json formatted. If you try to read json values from a file you have to do it like that:...
Read more >JSONDecodeError: Expecting value: line 2 column 1 (char 1)
Hello guys, I'm trying to connect Streamlit to a public Google Sheet, but I get the following error: JSONDecodeError: Expecting value: line ......
Read more >json.decoder.JSONDecodeError: Expecting value: line 1 ...
JSONDecodeError : Expecting value: line 1 column 1 (char 0) #47. Closed. chandrasg opened this issue on Nov 5, 2017 · 32 comments....
Read more >Expecting Value: Line 1 column 1 (char 0) - Python Pool
JSONDecodeError : Expecting value: line 1 column 1 (char 0) occurs while working with JSON (JavaScript Object Notation) format.
Read more >Weird: Json.Decoder.Jsondecodeerror: Expecting Value
Jsondecodeerror : Expecting Value: Line 1 Column 1 (Char 0). If you are a Windows user Tweepy API ... You can now view...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the assistance @DmitryKey.
So in the end the problem was the src/search_demo_solr.py file on line 122 :
docs,query_time, numfound = sc.query("vector", query)
where one needs to replace “vector” with the core name in your solr index which may be determined by the amount of files that one indexes(in my case it became vector_10 for 10 files.Edit: spelling
thanks for checking that!
How many dimensions do your vectors have? In my case I use 768 dim vectors, so the only way to query them is to use HTTP POST, because the character length of the query exceeds HTTP GET.
Btw, would you be open for a quick zoom call to show your vector search setup? It might be a little faster to figure things out. Ok, if not: we can also continue discussing here!