Duplicate this space doesn't work

#2
by firefighter - opened

I duplicate this space, but it’s not working properly. Is there any way to fix it?

===== Application Startup at 2024-12-03 06:13:47 =====

Matplotlib is building the font cache; this may take a moment.
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pydantic/type_adapter.py", line 271, in _init_core_attrs
self.core_schema = _getattr_no_parents(self._type, 'pydantic_core_schema')
File "/usr/local/lib/python3.8/site-packages/pydantic/type_adapter.py", line 55, in _getattr_no_parents
raise AttributeError(attribute)
AttributeError: pydantic_core_schema

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 113, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 187, in call
raise exc
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 165, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/cors.py", line 93, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/cors.py", line 144, in simple_response
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-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.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.8/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 715, in call
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 735, in app
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 288, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.8/site-packages/starlette/exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 73, in app
response = await f(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 291, in app
solved_result = await solve_dependencies(
File "/usr/local/lib/python3.8/site-packages/fastapi/dependencies/utils.py", line 666, in solve_dependencies
) = await request_body_to_args( # body_params checked above
File "/usr/local/lib/python3.8/site-packages/fastapi/dependencies/utils.py", line 891, in request_body_to_args
fields_to_extract = get_cached_model_fields(first_field.type
)
File "/usr/local/lib/python3.8/site-packages/fastapi/_compat.py", line 659, in get_cached_model_fields
return get_model_fields(model)
File "/usr/local/lib/python3.8/site-packages/fastapi/_compat.py", line 285, in get_model_fields
return [
File "/usr/local/lib/python3.8/site-packages/fastapi/_compat.py", line 286, in
ModelField(field_info=field_info, name=name)
File "", line 6, in init
File "/usr/local/lib/python3.8/site-packages/fastapi/_compat.py", line 111, in post_init
self._type_adapter: TypeAdapter[Any] = TypeAdapter(
File "/usr/local/lib/python3.8/site-packages/pydantic/type_adapter.py", line 228, in init
self._init_core_attrs(
File "/usr/local/lib/python3.8/site-packages/pydantic/type_adapter.py", line 290, in _init_core_attrs
core_schema = schema_generator.generate_schema(self._type)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 612, in generate_schema
schema = self._generate_schema_inner(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 865, in _generate_schema_inner
return self._annotated_schema(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1983, in _annotated_schema
schema = self._apply_annotations(source_type, annotations)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 2062, in _apply_annotations
schema = get_inner_schema(source_type)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in call
schema = self._handler(source_type)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 2137, in new_handler
schema = metadata_get_schema(source, get_inner_schema)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 2133, in
lambda source, handler: handler(source)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py", line 84, in call
schema = self._handler(source_type)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 2043, in inner_handler
schema = self._generate_schema_inner(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 886, in _generate_schema_inner
return self.match_type(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 988, in match_type
return self._match_generic_type(obj, origin)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1016, in _match_generic_type
return self._union_schema(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1327, in _union_schema
choices.append(self.generate_schema(arg))
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 612, in generate_schema
schema = self._generate_schema_inner(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 886, in _generate_schema_inner
return self.match_type(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 997, in match_type
return self._unknown_type_schema(obj)
File "/usr/local/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 515, in _unknown_type_schema
raise PydanticSchemaGenerationError(
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set arbitrary_types_allowed=True in the model_config to ignore this error or implement __get_pydantic_core_schema__ on your type to fully support it.

If you got this error by calling handler() within __get_pydantic_core_schema__ then you likely need to call handler.generate_schema(<some type>) since we do not call __get_pydantic_core_schema__ on <some type> otherwise to avoid infinite recursion.

For further information visit https://errors.pydantic.dev/2.10/u/schema-for-unknown-type

More detailed requirements might be helpful

OpenDataLab org

It's possible that you chose gradio when selecting the space type, but the space is a docker type and there are some dependencies that need to be installed through docker.
In addition, you can also refer to the code repo to build the environment locally.

I’m sure it was started in Docker mode. You can easily reproduce it by clicking the button "Duplicate this space".

Here is the build log

===== Build Queued at 2024-12-03 06:01:23 / Commit SHA: dab2a52 =====

--> FROM docker.io/library/python:3.8@sha256:d411270700143fa2683cc8264d9fa5d3279fd3b6afff62ae81ea2f9d070e390c
DONE 0.0s

--> WORKDIR /code
CACHED

--> Restoring cache
DONE 7.6s

--> RUN wget https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz && tar -xvf node-v16.13.1-linux-x64.tar.gz && mv node-v16.13.1-linux-x64 /usr/local/nodejs && ln -s /usr/local/nodejs/bin/node /usr/local/bin && ln -s /usr/local/nodejs/bin/npm /usr/local/bin && node -v
--2024-12-03 06:01:36-- https://registry.npmmirror.com/-/binary/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz
Resolving registry.npmmirror.com (registry.npmmirror.com)... 47.246.24.243, 47.246.24.248, 47.246.24.249, ...
Connecting to registry.npmmirror.com (registry.npmmirror.com)|47.246.24.243|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://cdn.npmmirror.com/binaries/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz [following]
--2024-12-03 06:01:36-- https://cdn.npmmirror.com/binaries/node/latest-v16.x/node-v16.13.1-linux-x64.tar.gz
Resolving cdn.npmmirror.com (cdn.npmmirror.com)... 47.246.24.217, 47.246.24.239, 47.246.24.242, ...
Connecting to cdn.npmmirror.com (cdn.npmmirror.com)|47.246.24.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32395116 (31M) [application/gzip]
Saving to: ‘node-v16.13.1-linux-x64.tar.gz’

 0K .......... .......... .......... .......... ..........  0% 9.99M 3s
50K .......... .......... .......... .......... ..........  0% 11.9M 3s

...
...
...

Installing collected packages: pytz, pydub, zipp, websockets, urllib3, tzdata, typing-extensions, tqdm, tomlkit, sniffio, six, shellingham, semantic-version, ruff, rpds-py, pyyaml, python-multipart, pyparsing, pygments, pkgutil-resolve-name, pillow, packaging, orjson, numpy, networkx, narwhals, mdurl, markupsafe, kiwisolver, idna, h11, fsspec, fonttools, filelock, ffmpy, exceptiongroup, cycler, click, charset-normalizer, certifi, attrs, aiofiles, uvicorn, tifffile, scipy, requests, referencing, PyWavelets, python-dateutil, pydantic-core, markdown-it-py, lazy_loader, jinja2, importlib-resources, imageio, httpcore, contourpy, anyio, annotated-types, starlette, scikit-image, rich, pydantic, pandas, matplotlib, jsonschema-specifications, huggingface-hub, httpx, typer, jsonschema, gradio-client, fastapi, altair, gradio
Successfully installed PyWavelets-1.4.1 aiofiles-23.2.1 altair-5.4.1 annotated-types-0.7.0 anyio-4.5.2 attrs-24.2.0 certifi-2024.8.30 charset-normalizer-3.4.0 click-8.1.7 contourpy-1.1.1 cycler-0.12.1 exceptiongroup-1.2.2 fastapi-0.115.5 ffmpy-0.4.0 filelock-3.16.1 fonttools-4.55.1 fsspec-2024.10.0 gradio-4.16.0 gradio-client-0.8.1 h11-0.14.0 httpcore-1.0.7 httpx-0.28.0 huggingface-hub-0.26.3 idna-3.10 imageio-2.35.1 importlib-resources-6.4.5 jinja2-3.1.4 jsonschema-4.23.0 jsonschema-specifications-2023.12.1 kiwisolver-1.4.7 lazy_loader-0.4 markdown-it-py-3.0.0 markupsafe-2.1.5 matplotlib-3.7.5 mdurl-0.1.2 narwhals-1.15.1 networkx-3.1 numpy-1.24.4 orjson-3.10.12 packaging-24.2 pandas-2.0.3 pillow-10.4.0 pkgutil-resolve-name-1.3.10 pydantic-2.10.2 pydantic-core-2.27.1 pydub-0.25.1 pygments-2.18.0 pyparsing-3.1.4 python-dateutil-2.9.0.post0 python-multipart-0.0.19 pytz-2024.2 pyyaml-6.0.2 referencing-0.35.1 requests-2.32.3 rich-13.9.4 rpds-py-0.20.1 ruff-0.8.1 scikit-image-0.20.0 scipy-1.9.1 semantic-version-2.10.0 shellingham-1.5.4 six-1.16.0 sniffio-1.3.1 starlette-0.41.3 tifffile-2023.7.10 tomlkit-0.12.0 tqdm-4.67.1 typer-0.14.0 typing-extensions-4.12.2 tzdata-2024.2 urllib3-2.2.3 uvicorn-0.32.1 websockets-11.0.3 zipp-3.20.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
DONE 28.7s

--> RUN useradd -m -u 1000 user
DONE 0.3s

--> WORKDIR /home/user/app
DONE 0.1s

--> COPY --chown=user . /home/user/app
DONE 0.1s

--> Pushing image
DONE 62.5s

--> Exporting cache
DONE 0.4s

Sign up or log in to comment