english-learning-tinykan / patch_gradio.py
mounam's picture
Update patch_gradio.py
4a32f18 verified
Raw
History Blame Contribute Delete
364 Bytes
import pathlib, re
print("Starting patch v15...")
f2 = pathlib.Path('/usr/local/lib/python3.10/site-packages/gradio/blocks.py')
txt2 = f2.read_text()
txt2 = re.sub(
r'raise ValueError\([^"]*"When localhost is not accessible[^)]*\)',
'pass # HF patch',
txt2, flags=re.DOTALL
)
f2.write_text(txt2)
print("✅ blocks.py patched")
print("✅ All done!")