Skip to content

TypeError: argument of type 'bool' is not iterable when calling get_api_info() #18

@ldblckrs-258

Description

@ldblckrs-258

Description:

I'm encountering a TypeError when using Gradio in my FastAPI app. The error occurs when calling get_api_info() on a Blocks instance. It seems that the library is attempting to iterate over a boolean instead of a dictionary in the JSON schema.


Stack Trace:

File "gradio_client/utils.py", line 866, in get_type
    if "const" in schema:
TypeError: argument of type 'bool' is not iterable

Full traceback:

Click to expand
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  ...
  File "gradio/routes.py", line 398, in api_info
    app.api_info = app.get_blocks().get_api_info()
  File "gradio/blocks.py", line 2535, in get_api_info
    python_type = client_utils.json_schema_to_python_type(info)
  File "gradio_client/utils.py", line 896, in json_schema_to_python_type
    type_ = _json_schema_to_python_type(schema, schema.get("$defs"))
  ...
  File "gradio_client/utils.py", line 866, in get_type
    if "const" in schema:
TypeError: argument of type 'bool' is not iterable

Environment:

  • OS: Ubuntu 20.04
  • Python: 3.10
  • Firebase Studio VPS

Steps to Reproduce:

  1. Run ./run.sh
  2. Go to website
  3. Press "Step 1 -Load viXTTS model"

Expected Behavior:

Model loading progress start.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions