import sys, re path = "/usr/local/lib/python3.12/site-packages/gradio_client/utils.py" with open(path) as f: c = f.read() # Replace all bare 'in schema' checks with dict-guarded versions in both functions c = re.sub( r'if "(\w+)" in schema:', r'if isinstance(schema, dict) and "\1" in schema:', c ) with open(path, "w") as f: f.write(c) print("Patched all schema dict checks in gradio_client/utils.py") sys.exit(0)