gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.98k stars 2.49k forks source link

shortgpt error when running the code #7364

Closed Jinyoung3 closed 8 months ago

Jinyoung3 commented 8 months ago

Describe the bug

Traceback (most recent call last): File "/app/./runShortGPT.py", line 1, in from gui.gui_gradio import ShortGptUI File "/app/gui/gui_gradio.py", line 1, in import gradio as gr File "/usr/local/lib/python3.11/site-packages/gradio/init.py", line 3, in import gradio.components as components File "/usr/local/lib/python3.11/site-packages/gradio/components/init.py", line 1, in from gradio.components.annotated_image import AnnotatedImage File "/usr/local/lib/python3.11/site-packages/gradio/components/annotated_image.py", line 8, in from gradio_client.documentation import document, set_documentation_group ImportError: cannot import name 'set_documentation_group' from 'gradio_client.documentation' (/usr/local/lib/python3.11/site-packages/gradio_client/documentation.py)

this is what I get and I do not know how to fix the issue

Have you searched existing issues? 🔎

Reproduction

import gradio as gr

Screenshot

No response

Logs

No response

System Info

e

Severity

I can work around it

abidlabs commented 8 months ago

Hi @Jinyoung3 can you please provide a minimal code example that we can use to reproduce the issue above? See: https://stackoverflow.com/help/minimal-reproducible-example

Jinyoung3 commented 8 months ago

yea the code is here: https://github.com/RayVentura/ShortGPT you need to create a file called ".env" and put in your openai key and elevenlabs API key and when you run docker build -t short_gpt_docker:latest . and then docker run -p 31415:31415 --env-file .env short_gpt_docker:latest I get that error.

abidlabs commented 8 months ago

Ok so what happened is that we released a more recent version of gradio_client that is incompatible with your version of gradio. And this is using a really old version of gradio that we don't really support anymore.

But I think you should be able to get it to work again by pinning the gradio_client to an older version. I've opened a PR here that should work I believe: https://github.com/RayVentura/ShortGPT/pull/129

abidlabs commented 8 months ago

Will close for now but don't hesitate to reach back out on this thread with any questions or issues.

Jinyoung3 commented 8 months ago

Traceback (most recent call last): File "/app/./runShortGPT.py", line 1, in from gui.gui_gradio import ShortGptUI File "/app/gui/gui_gradio.py", line 3, in from gui.content_automation_ui import GradioContentAutomationUI File "/app/gui/content_automation_ui.py", line 3, in from gui.ui_tab_short_automation import ShortAutomationUI File "/app/gui/ui_tab_short_automation.py", line 6, in from gui.asset_components import AssetComponentsUtils File "/app/gui/asset_components.py", line 8, in from shortGPT.config.api_db import ApiKeyManager File "/app/shortGPT/config/init.py", line 1, in from . import config File "/app/shortGPT/config/config.py", line 1, in import yaml ModuleNotFoundError: No module named 'yaml' this is what I get now

abidlabs commented 8 months ago

Sorry I meant you have to do this:

pip install gradio_client==0.2.10

And it looks like you need yaml as well so please do:

pip install pyyaml

Jinyoung3 commented 8 months ago

So I keep what I have and just run the commands u told me to do?

Jinyoung3 commented 8 months ago

also those didn't work. Do you think the error is coming from shortGPT?

abidlabs commented 8 months ago

Yes it seems that their requirements.txt file might be out of date. I’d recommend opening an issue on their repo

Jinyoung3 commented 8 months ago

ffmpeg ffmpeg-python python-dotenv gradio_client==0.2.10 gradio==3.38.0 openai==1.10.0 tiktoken tinydb tinymongo proglog yt-dlp torch torchaudio

whisper timestamped

whisper-timestamped protobuf==3.20.3 pillow==9.0.0 moviepy==1.0.3 progress questionary edge-tts TTS==0.22.0 even after changing to this I get error do you know why?