Fix ValueErrors for gradio/demo/random_demos.py
Closed this issue · 0 comments
meg-huggingface commented
Describe the bug
The random_demos.py
script will throw ValueError
s when it tries to remove directories it doesn't find.
There are 2 reasons the directories are not found:
- The script hardcodes an assumption that it's being run specifically from the
gradio/demo
directory. - The script hardcodes an assumption that there are 3 specific directories that are unwanted.
Fixing (1) still leaves you with the issue of (2).
The ValueError for (1) refers to 'streaming_wav2vec' and the ValueError for (2) refers to '.gradio/flagged' (log below)
Have you searched existing issues? 🔎
- I have searched and found no existing issues
Reproduction
- git clone the repository at https://github.com/gradio-app/gradio
- set up everything following CONTRIBUTING.md
- in the
gradio
directory, rundemo/random_demos.py
Screenshot
No response
Logs
(.venv) (base) me@my-computer gradio % python demo/random_demos.py 2
Traceback (most recent call last):
File "/Users/margaretmitchell/HuggingFace/git/gradio/demo/random_demos.py", line 27, in <module>
demos_list.remove('streaming_wav2vec')
ValueError: list.remove(x): x not in list
And then going to the correct directory that's currently assumed (demo), I get the same error when the program tries to remove `.gradio/flagged`
System Info
From cloned git repo, most recent commit: c0cf80bddd99ad0f836e618cc3d2b13e73cb5611
Severity
I can work around it