We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ERROR: Exception in ASGI application Traceback (most recent call last): File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 240, in run_asgi result = await self.app(self.scope, self.asgi_receive, self.asgi_send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__ return await self.app(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/middleware/errors.py", line 151, in __call__ await self.app(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/middleware/cors.py", line 77, in __call__ await self.app(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__ await self.middleware_stack(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/routing.py", line 373, in handle await self.app(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/routing.py", line 96, in app await wrap_app_handling_exceptions(app, session)(scope, receive, send) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/routing.py", line 94, in app await func(session) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/fastapi/routing.py", line 348, in app await dependant.call(**values) File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/gradio/routes.py", line 265, in notify_changes await websocket.close() File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/websockets.py", line 203, in close await self.send( File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/starlette/websockets.py", line 112, in send raise RuntimeError('Cannot call "send" once a close message has been sent.') RuntimeError: Cannot call "send" once a close message has been sent.
import os import gradio as gr import torch import requests from torchvision import transforms model = torch.hub.load("pytorch/vision:v0.6.0", "resnet18", weights='ResNet18_Weights.IMAGENET1K_V1').eval() response = requests.get("https://git.io/JJkYN") labels = response.text.split("\n") def predict(inp): inp = transforms.ToTensor()(inp).unsqueeze(0) with torch.no_grad(): prediction = torch.nn.functional.softmax(model(inp)[0], dim=0) confidences = {labels[i]: float(prediction[i]) for i in range(1000)} return confidences dir_path = os.path.dirname(os.path.realpath(__file__)) demo = gr.Interface( fn=predict, inputs=gr.components.Image(type="pil"), outputs=gr.components.Label(num_top_classes=3), examples=[[f"{dir_path}/cheetah.jpg"]], ) demo.launch()
NA
⚡ ~ python -V Python 3.10.10 ⚡ ~ pip list | grep gradio gradio 3.50.2 gradio_client 0.6.1
I can work around it
The text was updated successfully, but these errors were encountered:
Hi @tchaton ? Does this happen in the latest version (4.30.1)? We don't release back-patches for previous versions.
4.30.1
Sorry, something went wrong.
Going to close for now, can reopen with clarification
No branches or pull requests
Describe the bug
Have you searched existing issues? 🔎
Reproduction
Screenshot
NA
Logs
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: