Colab; infer-web.py have an issue with gradio
Input:
!python3 infer-web.py --colab --pycmd python3
Output:
Traceback (most recent call last):
File "/content/Retrieval-based-Voice-Conversion-WebUI/infer-web.py", line 96, in <module>
class ToolButton(gr.Button, gr.components.FormComponent):
AttributeError: module 'gradio.components' has no attribute 'FormComponent'. Did you mean: 'IOComponent'?
Same issue, I hope this gets fixed soon...
Same issue here!
Edit: The solution right below this comment is simpler and persists across sessions, so use that instead!
I fixed this by changing the offending line in infer-web.py to use gr.components.IOComponent instead.
Open the file browser on the left panel, open up the Retrieval-based-Voice-Conversion-WebUI folder, then double click on infer-web.py to open it in Colab's text editor. It should open on the right panel. Then I went to the line specified in the error (for me it was line 87, it seems like it'll be a different line for different people like the OP who had it on line 96) and then replaced FormComponent with IOComponent, i.e.:
class ToolButton(gr.Button, gr.components.FormComponent):
to
class ToolButton(gr.Button, gr.components.IOComponent):
That's all I needed to do to get the UI working like before, at least for inference.
I fixed this by changing the offending line in infer-web.py to use
gr.components.IOComponentinstead.Open the file browser on the left panel, open up the
Retrieval-based-Voice-Conversion-WebUIfolder, then double click oninfer-web.pyto open it in Colab's text editor. It should open on the right panel. Then I went to the line specified in the error (for me it was line 87, it seems like it'll be a different line for different people like the OP who had it on line 96) and then replacedFormComponentwithIOComponent, i.e.:class ToolButton(gr.Button, gr.components.FormComponent):to
class ToolButton(gr.Button, gr.components.IOComponent):That's all I needed to do to get the UI working like before, at least for inference.
edit the cell gradio to gradio==3.34.0
Edit: The solution right below this comment is simpler and persists across sessions, so use that instead!
I fixed this by changing the offending line in infer-web.py to use
gr.components.IOComponentinstead.Open the file browser on the left panel, open up the
Retrieval-based-Voice-Conversion-WebUIfolder, then double click oninfer-web.pyto open it in Colab's text editor. It should open on the right panel. Then I went to the line specified in the error (for me it was line 87, it seems like it'll be a different line for different people like the OP who had it on line 96) and then replacedFormComponentwithIOComponent, i.e.:class ToolButton(gr.Button, gr.components.FormComponent):to
class ToolButton(gr.Button, gr.components.IOComponent):That's all I needed to do to get the UI working like before, at least for inference.
THank you!!!