Update app.py
Browse files
app.py
CHANGED
@@ -487,16 +487,14 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
|
|
487 |
# 程序入口 (Entry Point)
|
488 |
# ==============================================================================
|
489 |
if __name__ == "__main__":
|
490 |
-
|
491 |
-
os.makedirs("audio")
|
492 |
# A quick check to see if we're in a deployed Space, to avoid local errors.
|
493 |
if "SPACE_ID" in os.environ:
|
494 |
print("Running in a Hugging Face Space, checking for audio files...")
|
495 |
# In a real deployment, you'd ensure the audio files are in the repo.
|
496 |
# This is just a placeholder check.
|
497 |
-
|
498 |
-
print(DIMENSIONS_DATA[0])
|
499 |
-
all_files = [q["audio"][0] for q in QUESTION_SET] + [d["audio"][0] for d in DIMENSIONS_DATA]
|
500 |
for audio_file in set(all_files):
|
501 |
if not os.path.exists(audio_file):
|
502 |
print(f"⚠️ Warning: Audio file not found: {audio_file}")
|
|
|
487 |
# 程序入口 (Entry Point)
|
488 |
# ==============================================================================
|
489 |
if __name__ == "__main__":
|
490 |
+
if not os.path.exists("audio"):
|
491 |
+
os.makedirs("audio")
|
492 |
# A quick check to see if we're in a deployed Space, to avoid local errors.
|
493 |
if "SPACE_ID" in os.environ:
|
494 |
print("Running in a Hugging Face Space, checking for audio files...")
|
495 |
# In a real deployment, you'd ensure the audio files are in the repo.
|
496 |
# This is just a placeholder check.
|
497 |
+
all_files = [q["audio"] for q in QUESTION_SET] + [d["audio"] for d in DIMENSIONS_DATA]
|
|
|
|
|
498 |
for audio_file in set(all_files):
|
499 |
if not os.path.exists(audio_file):
|
500 |
print(f"⚠️ Warning: Audio file not found: {audio_file}")
|