Python, Artificial Intelligence, Serverless, Hugging Face, Local Gpt.
json_object = json.loads(res) rec_image = json_object["gen_image"] png_recovered = base64.b64decode(rec_image) return png_recovered We read the response and decode it into utf-8 format res = response.content.decode('utf-8') we convert the byte-string into a json object json_object = json.loads(res)