Verba icon indicating copy to clipboard operation
Verba copied to clipboard

type object 'GeneratePayload' has no attribute 'model_validate_json'

Open wccyzxy opened this issue 1 year ago • 2 comments

Error:

✘ WebSocket Error: type object 'GeneratePayload' has no attribute
'model_validate_json'
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/output/Verba/goldenverba/server/api.py", line 597, in websocket_generate_stream
    payload = GeneratePayload.model_validate_json(data)
AttributeError: type object 'GeneratePayload' has no attribute 'model_validate_json'

Solution:

# api.py
import json

# change the code in line 597
payload = GeneratePayload.parse_obj(json.loads(data))

wccyzxy avatar Jan 27 '24 05:01 wccyzxy