All lessons up to Lesson 7 worked fine.
But, in this lesson, when running step “Prefill vs Decode (KV Cache)” I get the error “JSONDecodeError: Expecting value: line 1 column 1 (char 0)”
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
File /usr/local/lib/python3.11/site-packages/requests/models.py:971, in Response.json(self, **kwargs)
970 try:
--> 971 return complexjson.loads(self.text, **kwargs)
972 except JSONDecodeError as e:
973 # Catch JSON-related errors and raise as requests.JSONDecodeError
974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
File /usr/local/lib/python3.11/json/__init__.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
343 if (cls is None and object_hook is None and
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
File /usr/local/lib/python3.11/json/decoder.py:337, in JSONDecoder.decode(self, s, _w)
333 """Return the Python representation of ``s`` (a ``str`` instance
334 containing a JSON document).
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
File /usr/local/lib/python3.11/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
JSONDecodeError Traceback (most recent call last)
Cell In[14], line 2
1 t0 = time.time()
----> 2 resp = client.generate("What is deep learning?", max_new_tokens=32)
3 duration_s = time.time() - t0
5 print(resp.generated_text)
File /usr/local/lib/python3.11/site-packages/lorax/client.py:182, in Client.generate(self, prompt, adapter_id, adapter_source, merged_adapters, api_token, do_sample, max_new_tokens, best_of, repetition_penalty, return_full_text, seed, stop_sequences, temperature, top_k, top_p, truncate, typical_p, watermark, response_format, decoder_input_details, details)
173 resp = requests.post(
174 self.base_url,
175 json=request.dict(by_alias=True),
(...)
178 timeout=self.timeout,
179 )
181 # TODO: expose better error messages for 422 and similar errors
--> 182 payload = resp.json()
183 if resp.status_code != 200:
184 raise parse_error(resp.status_code, payload)
File /usr/local/lib/python3.11/site-packages/requests/models.py:975, in Response.json(self, **kwargs)
971 return complexjson.loads(self.text, **kwargs)
972 except JSONDecodeError as e:
973 # Catch JSON-related errors and raise as requests.JSONDecodeError
974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)