RuntimeError: Unexpected ASGI message 'websocket.close', after sending 'websocket.close'

Task exception was never retrieved
future: <Task finished name=‘Task-75’ coro=<Queue.process_event() done, defined at /home/user/.local/lib/python3.8/site-packages/gradio/queue.py:222> exception=RuntimeError(“Unexpected ASGI message ‘websocket.close’, after sending ‘websocket.close’.”)>
Traceback (most recent call last):
File “/home/user/.local/lib/python3.8/site-packages/gradio/queue.py”, line 275, in process_event
await event.disconnect()
File “/home/user/.local/lib/python3.8/site-packages/gradio/queue.py”, line 305, in disconnect
await self.websocket.close(code=code)
File “/home/user/.local/lib/python3.8/site-packages/starlette/websockets.py”, line 180, in close
await self.send(
File “/home/user/.local/lib/python3.8/site-packages/starlette/websockets.py”, line 85, in send
await self._send(message)
File “/home/user/.local/lib/python3.8/site-packages/uvicorn/protocols/websockets/websockets_impl.py”, line 316, in asgi_send
raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message ‘websocket.close’, after sending ‘websocket.close’.

‘’'---------------------------

Traceback (most recent call last):
File “/home/user/.local/lib/python3.8/site-packages/gradio/routes.py”, line 275, in run_predict
output = await app.blocks.process_api(
File “/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py”, line 760, in process_api
result = await self.call_function(fn_index, inputs, iterator)
File “/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py”, line 671, in call_function
prediction = await anyio.to_thread.run_sync(
File “/home/user/.local/lib/python3.8/site-packages/anyio/to_thread.py”, line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File “/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py”, line 937, in run_sync_in_worker_thread
return await future
File “/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py”, line 867, in run
result = context.run(func, *args)
File “app.py”, line 170, in predict
images = pipe(prompt = prompt, init_image=init_image, mask_image=mask, strength=0.8)[“sample”]
File “/home/user/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py”, line 27, in decorate_context
return func(*args, **kwargs)
File “/home/user/app/inpainting.py”, line 97, in call
init_latent_dist = self.vae.encode(init_image).latent_dist
File “/home/user/.local/lib/python3.8/site-packages/diffusers/models/vae.py”, line 549, in encode
h = self.encoder(x)
File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_impl
return forward_call(*input, **kwargs)
File “/home/user/.local/lib/python3.8/site-packages/diffusers/models/vae.py”, line 121, in forward
sample = down_block(sample)
File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_impl
return forward_call(*input, **kwargs)
File “/home/user/.local/lib/python3.8/site-packages/diffusers/models/unet_blocks.py”, line 708, in forward
hidden_states = resnet(hidden_states, temb=None)
File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_impl
return forward_call(*input, **kwargs)
File “/home/user/.local/lib/python3.8/site-packages/diffusers/models/resnet.py”, line 359, in forward
hidden_states = self.norm1(hidden_states)
File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_impl
return forward_call(*input, **kwargs)
File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/normalization.py”, line 272, in forward
return F.group_norm(
File “/home/user/.local/lib/python3.8/site-packages/torch/nn/functional.py”, line 2516, in group_norm
return torch.group_norm(input, num_groups, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: expected scalar type BFloat16 but found Half