Fix startup crash: TypeError (gradio-api-drift)

#7
by kavyabhand - opened

Hi! This Space currently fails to start on Hugging Face with:

TypeError: BlockContext.__init__() got an unexpected keyword argument 'allow_flagging'

Cause. Gradio 6.0 no longer accepts allow_flagging in Interface (log: TypeError: BlockContext.__init__() got an unexpected keyword argument 'allow_flagging'), and css must be passed to launch() instead of the constructor (UserWarning in log).

Change. README.md, app.py. python_version is pinned in the README to the interpreter we tested with. Nothing else is touched.

Tested. We rebuilt the Space with this patch the way Spaces builds it (README front-matter, requirements.txt, then the SDK), on 2 vCPU / 16 GB, like cpu-basic. The app started, and calling its /upscale endpoint returned:

1 output file(s) (webp), non-empty

The diagnosis and patch were written by Beam (Reflection AI's open model) as part of Space Doctor, a Build with Beam challenge project that repairs broken Spaces and only proposes fixes that pass this check. We read the diff before opening this PR. Feel free to close it if you'd rather fix it another way.

Davidsamuel101 changed pull request status to closed

Sign up or log in to comment