CircleRadon / Osprey

[CVPR2024] The code for "Osprey: Pixel Understanding with Visual Instruction Tuning"
Apache License 2.0
775 stars 42 forks source link

ERROR AT END. #9

Open prabin333 opened 10 months ago

prabin333 commented 10 months ago

34s !python /content/Osprey/demo/app.py --model sunshine-lwt/Osprey-7b output 2024-01-14 16:21:15.919229: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2024-01-14 16:21:15.919294: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2024-01-14 16:21:15.919351: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2024-01-14 16:21:17.052157: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT Loading checkpoint shards: 100% 2/2 [00:12<00:00, 6.40s/it] Some weights of the model checkpoint at sunshine-lwt/Osprey-7b were not used when initializing OspreyLlamaForCausalLM: ['model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.22.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.13.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.0.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.3.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.16.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.3.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.23.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.5.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.15.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.4.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.9.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.14.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.21.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.3.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.17.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.18.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.20.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.11.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.24.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.10.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.25.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.3.blocks.2.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.0.blocks.2.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.1.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.19.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.8.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.7.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.0.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.6.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.2.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.26.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.1.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.12.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.1.blocks.2.weight']

CircleRadon commented 10 months ago

Hi, @prabin333 you should download ViT-B SAM model to ./checkpoints,

or change this line to the path of ViT-B SAM model. https://github.com/CircleRadon/Osprey/blob/ce786ba5f612de3166039c4a9c196f77352f702c/demo/inference.py#L8

prabin333 commented 10 months ago

I'm currently using Google Colab. Could you please guide me on where to put the checkpoints folder and other required folders? I have already downloaded the Vit-B, SAM, and CLIP models, and placed them inside the checkpoints folder.

2024-01-18 05:23:43.070875: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2024-01-18 05:23:43.070933: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2024-01-18 05:23:43.073035: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2024-01-18 05:23:44.112812: W tensorflow/compiler/tf2tensorrt/utils/pyutils.cc:38] TF-TRT Warning: Could not find TensorRT Traceback (most recent call last): File "/content/Osprey/demo/app.py", line 19, in osprey = Osprey(model_path=args.model) File "/content/Osprey/demo/osprey_inference.py", line 43, in init self.model = OspreyLlamaForCausalLM.from_pretrained( File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 3462, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/usr/local/lib/python3.10/dist-packages/osprey/model/language_model/osprey_llama.py", line 45, in init self.model = OspreyLlamaModel(config) File "/usr/local/lib/python3.10/dist-packages/osprey/model/language_model/osprey_llama.py", line 37, in init super(OspreyLlamaModel, self).init(config) File "/usr/local/lib/python3.10/dist-packages/osprey/model/osprey_arch.py", line 31, in init self.vision_tower = build_vision_tower(config, delay_load=False) File "/usr/local/lib/python3.10/dist-packages/osprey/model/multimodal_encoder/builder.py", line 7, in build_vision_tower return CLIPVisionTower(args=vision_tower_cfg) File "/usr/local/lib/python3.10/dist-packages/osprey/model/multimodal_encoder/clip_encoder.py", line 20, in init self.load_model() File "/usr/local/lib/python3.10/dist-packages/osprey/model/multimodal_encoder/clip_encoder.py", line 29, in load_model self.vision_tower.load_state_dict(torch.load(self.clip_model),strict=False) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 791, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 271, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 252, in init super().init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'open_clip_pytorch_model.bin'

CircleRadon commented 10 months ago

It appears that the path to the CLIP model is incorrect. Based on the error message and the location of your checkpoints, please update this line in the config.json file of Osprey-7b model to reflect the correct path for the CLIP model, i.e., ./checkpoints/open_clip_pytorch_model.bin.

prabin333 commented 10 months ago

After modifying the path for the models as per your instructions, a new error is occurring. Could you provide a solution to solve the specific error message?

Downloading shards: 100% 2/2 [06:42<00:00, 201.50s/it] Loading checkpoint shards: 100% 2/2 [00:12<00:00, 6.06s/it] Some weights of the model checkpoint at sunshine-lwt/Osprey-7b were not used when initializing OspreyLlamaForCausalLM: ['model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.25.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.24.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.14.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.1.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.15.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.20.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.5.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.19.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.23.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.26.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.9.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.13.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.3.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.4.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.3.blocks.2.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.18.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.0.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.10.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.22.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.3.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.16.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.11.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.7.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.6.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.3.blocks.1.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.8.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.0.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.21.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.17.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.1.blocks.0.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.2.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.0.blocks.2.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.2.blocks.12.weight', 'model.vision_tower.vision_tower.visual.trunk.stages.1.blocks.2.weight']

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 762, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 782, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 72, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 299, in app raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 294, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 40, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/content/gradio-osprey-demo/gradio/routes.py", line 282, in main raise ValueError( ValueError: Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh ERROR: Exception in ASGI application Traceback (most recent call last): File "/content/gradio-osprey-demo/gradio/routes.py", line 271, in main return templates.TemplateResponse( File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 223, in TemplateResponse template = self.get_template(name) File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 137, in get_template return self.env.get_template(name) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 204, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: frontend/index.html

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 762, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 782, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 72, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 299, in app raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 294, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 40, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/content/gradio-osprey-demo/gradio/routes.py", line 282, in main raise ValueError( ValueError: Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh ERROR: Exception in ASGI application Traceback (most recent call last): File "/content/gradio-osprey-demo/gradio/routes.py", line 271, in main return templates.TemplateResponse( File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 223, in TemplateResponse template = self.get_template(name) File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 137, in get_template return self.env.get_template(name) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 204, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: frontend/index.html

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 762, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 782, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 72, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 299, in app raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 294, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 40, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/content/gradio-osprey-demo/gradio/routes.py", line 282, in main raise ValueError( ValueError: Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh ERROR: Exception in ASGI application Traceback (most recent call last): File "/content/gradio-osprey-demo/gradio/routes.py", line 271, in main return templates.TemplateResponse( File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 223, in TemplateResponse template = self.get_template(name) File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 137, in get_template return self.env.get_template(name) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 204, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: frontend/index.html

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 762, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 782, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 72, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 299, in app raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 294, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 40, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/content/gradio-osprey-demo/gradio/routes.py", line 282, in main raise ValueError( ValueError: Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh ERROR: Exception in ASGI application Traceback (most recent call last): File "/content/gradio-osprey-demo/gradio/routes.py", line 271, in main return templates.TemplateResponse( File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 223, in TemplateResponse template = self.get_template(name) File "/usr/local/lib/python3.10/dist-packages/starlette/templating.py", line 137, in get_template return self.env.get_template(name) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 1010, in get_template return self._load_template(name, globals) File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 969, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/usr/local/lib/python3.10/dist-packages/jinja2/loaders.py", line 204, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: frontend/index.html

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 762, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 782, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 72, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 299, in app raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 294, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 193, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 40, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/content/gradio-osprey-demo/gradio/routes.py", line 282, in main raise ValueError( ValueError: Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh Traceback (most recent call last): File "/content/Osprey/demo/app.py", line 501, in demo.queue(concurrency_count=1).launch(debug=True, server_port=8002) File "/content/gradio-osprey-demo/gradio/blocks.py", line 1899, in launch raise ValueError( ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.

CircleRadon commented 10 months ago

In colab, localhost is not accessible, you can set os.environ["no_proxy"] = "localhost,127.0.0.1,::1” in colab. I tried it and it works. Pasted Graphic

prabin333 commented 10 months ago

import os os.environ["no_proxy"] = "localhost,127.0.0.1,::1"

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/httpx/_urlparse.py", line 339, in normalize_port port_as_int = int(port) ValueError: invalid literal for int() with base 10: ':1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/content/Osprey/demo/app.py", line 5, in import gradio as gr File "/content/gradio-osprey-demo/gradio/init.py", line 3, in import gradio.components as components File "/content/gradio-osprey-demo/gradio/components/init.py", line 1, in from gradio.components.annotated_image import AnnotatedImage File "/content/gradio-osprey-demo/gradio/components/annotated_image.py", line 12, in from gradio import utils File "/content/gradio-osprey-demo/gradio/utils.py", line 346, in class AsyncRequest: File "/content/gradio-osprey-demo/gradio/utils.py", line 365, in AsyncRequest client = httpx.AsyncClient() File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1408, in init self._mounts: typing.Dict[URLPattern, typing.Optional[AsyncBaseTransport]] = { File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1409, in URLPattern(key): None File "/usr/local/lib/python3.10/dist-packages/httpx/_utils.py", line 397, in init url = URL(pattern) File "/usr/local/lib/python3.10/dist-packages/httpx/_urls.py", line 113, in init self._uri_reference = urlparse(url, **kwargs) File "/usr/local/lib/python3.10/dist-packages/httpx/_urlparse.py", line 246, in urlparse parsed_port: typing.Optional[int] = normalize_port(port, scheme) File "/usr/local/lib/python3.10/dist-packages/httpx/_urlparse.py", line 341, in normalize_port raise InvalidURL("Invalid port") httpx.InvalidURL: Invalid port