File size: 795 Bytes
0d76968
1b2b3ce
 
f61ae03
1b2b3ce
 
f61ae03
1b2b3ce
0d76968
1
2
3
4
5
6
7
8
9
10
#!/bin/bash
# Patch Gradio to avoid AttributeError: __provides__ with zope.interface
python -c "import os, gradio.components.base as b; path=b.__file__; c=open(path).read(); open(path, 'w').write(c.replace('if callable(getattr(self, value))', 'if value != \"__provides__\" and callable(getattr(self, value))').replace('getattr(self, value)', '(getattr(self, value) if value != \"__provides__\" else None)'))"

# Patch Gradio Client to avoid TypeError in schema generation
python -c "import os, gradio_client.utils as u; path=u.__file__; c=open(path).read(); open(path, 'w').write(c.replace('if \"const\" in schema:', 'if isinstance(schema, dict) and \"const\" in schema:').replace('if \"enum\" in schema:', 'if isinstance(schema, dict) and \"enum\" in schema:'))"

# Start the app
python app.py