fixing demo issue with website (#1047)

This commit is contained in:
Ali Abdalla 2022-04-21 02:06:51 +02:00 committed by GitHub
parent 161a7a8472
commit 84cdcf3647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,8 @@ def run():
) )
demo_folder_file.Upload() demo_folder_file.Upload()
demo_folder = demo_folder_file.metadata["id"] demo_folder = demo_folder_file.metadata["id"]
for demo_name in os.listdir(GRADIO_DEMO_DIR): for demo_name in [demo_dir for demo_dir in os.listdir(GRADIO_DEMO_DIR)
if os.path.isdir(os.path.join(GRADIO_DEMO_DIR, demo_dir))]:
notebook_title = demo_name + ".ipynb" notebook_title = demo_name + ".ipynb"
print("--- " + demo_name + " ---") print("--- " + demo_name + " ---")
with open(os.path.join(GRADIO_DEMO_DIR, demo_name, "run.py")) as demo_file: with open(os.path.join(GRADIO_DEMO_DIR, demo_name, "run.py")) as demo_file: