Spaces:
Paused
Paused
Merge pull request #4 from MomsVoiceAI/fix/image-path
Browse files- app.py +5 -5
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -66,11 +66,11 @@ for key, (path, dur, mel) in create_sound_library.items():
|
|
| 66 |
if not os.path.exists(path):
|
| 67 |
generate_chimes_wav(path, duration=dur, melody_type=mel)
|
| 68 |
|
| 69 |
-
COVERS_DIR = Path("assets/covers"
|
| 70 |
|
| 71 |
def cover_path(slug: str) -> str:
|
| 72 |
p = COVERS_DIR / f"{slug}.png"
|
| 73 |
-
return f"/gradio_api/file={p.as_posix()}"
|
| 74 |
|
| 75 |
def load_books_from_stories(stories_dir="stories"):
|
| 76 |
books = []
|
|
@@ -457,7 +457,7 @@ with gr.Blocks(css=css_code, title="VoiceBook Gradio Hub") as demo:
|
|
| 457 |
|
| 458 |
# Story text display + slider
|
| 459 |
story_text_display = gr.HTML(visible=False)
|
| 460 |
-
timeline_slider = gr.Slider(minimum=0, maximum=
|
| 461 |
|
| 462 |
# Q&A Panel
|
| 463 |
qa_panel = gr.HTML("""
|
|
@@ -623,7 +623,7 @@ with gr.Blocks(css=css_code, title="VoiceBook Gradio Hub") as demo:
|
|
| 623 |
# 2. Book card click β load into player
|
| 624 |
def handle_book_select(title_chosen, current_inventory):
|
| 625 |
if not title_chosen:
|
| 626 |
-
return [gr.update()] *
|
| 627 |
selected = next((b for b in current_inventory if b["title"] == title_chosen), current_inventory[0])
|
| 628 |
|
| 629 |
player_html = f"""
|
|
@@ -922,4 +922,4 @@ with gr.Blocks(css=css_code, title="VoiceBook Gradio Hub") as demo:
|
|
| 922 |
offline_toggle.change(toggle_outage_sandbox, inputs=[offline_toggle], outputs=[system_error_modal, main_tabs])
|
| 923 |
|
| 924 |
if __name__ == "__main__":
|
| 925 |
-
demo.queue().launch(allowed_paths=["assets"])
|
|
|
|
| 66 |
if not os.path.exists(path):
|
| 67 |
generate_chimes_wav(path, duration=dur, melody_type=mel)
|
| 68 |
|
| 69 |
+
COVERS_DIR = Path(__file__).parent / "assets" / "covers"
|
| 70 |
|
| 71 |
def cover_path(slug: str) -> str:
|
| 72 |
p = COVERS_DIR / f"{slug}.png"
|
| 73 |
+
return f"/gradio_api/file={p.resolve().as_posix()}"
|
| 74 |
|
| 75 |
def load_books_from_stories(stories_dir="stories"):
|
| 76 |
books = []
|
|
|
|
| 457 |
|
| 458 |
# Story text display + slider
|
| 459 |
story_text_display = gr.HTML(visible=False)
|
| 460 |
+
timeline_slider = gr.Slider(minimum=0, maximum=100, step=1, value=0, label="π Story position (paragraph)", visible=False)
|
| 461 |
|
| 462 |
# Q&A Panel
|
| 463 |
qa_panel = gr.HTML("""
|
|
|
|
| 623 |
# 2. Book card click β load into player
|
| 624 |
def handle_book_select(title_chosen, current_inventory):
|
| 625 |
if not title_chosen:
|
| 626 |
+
return [gr.update()] * 11
|
| 627 |
selected = next((b for b in current_inventory if b["title"] == title_chosen), current_inventory[0])
|
| 628 |
|
| 629 |
player_html = f"""
|
|
|
|
| 922 |
offline_toggle.change(toggle_outage_sandbox, inputs=[offline_toggle], outputs=[system_error_modal, main_tabs])
|
| 923 |
|
| 924 |
if __name__ == "__main__":
|
| 925 |
+
demo.queue().launch(allowed_paths=[str(Path(__file__).parent / "assets")])
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio
|
| 2 |
transformers
|
| 3 |
torch
|
| 4 |
accelerate
|
|
|
|
| 1 |
+
gradio==5.33.0
|
| 2 |
transformers
|
| 3 |
torch
|
| 4 |
accelerate
|