-
Notifications
You must be signed in to change notification settings - Fork 788
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
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'dataclasses._HAS_DEFAULT_FACTORY_CLASS'> #2133
Comments
working on fix, looks like simple pydantic bug |
encountered the same issue |
same here. |
Here to report the same issue.
|
Same issue. (calling the API via typescript client). |
I fixed it here, just a simple bug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is code example:
here is error log:
`{
"name": "JSONDecodeError",
"message": "Expecting value: line 1 column 1 (char 0)",
"stack": "---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
File ~/anaconda3/envs/work/lib/python3.10/site-packages/requests/models.py:974, in Response.json(self, **kwargs)
973 try:
--> 974 return complexjson.loads(self.text, **kwargs)
975 except JSONDecodeError as e:
976 # Catch JSON-related errors and raise as requests.JSONDecodeError
977 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
File ~/anaconda3/envs/work/lib/python3.10/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 ~/anaconda3/envs/work/lib/python3.10/json/decoder.py:337, in JSONDecoder.decode(self, s, _w)
333 """Return the Python representation of
s
(astr
instance334 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 ~/anaconda3/envs/work/lib/python3.10/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[7], line 14
7 gen_conf_1['override_settings']['sd_model_checkpoint'] = 'colorfulxl_v70'
9 response = requests.post(
10 url=url,
11 headers={"accept": "application/json"},
12 json=gen_conf,
13 )
---> 14 img = response.json()["images"][0].split(",", 1)[0]
16 # Decode the base64 string
17 img_data = base64.b64decode(img)
File ~/anaconda3/envs/work/lib/python3.10/site-packages/requests/models.py:978, in Response.json(self, **kwargs)
974 return complexjson.loads(self.text, **kwargs)
975 except JSONDecodeError as e:
976 # Catch JSON-related errors and raise as requests.JSONDecodeError
977 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 978 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)"
}
`
The text was updated successfully, but these errors were encountered: