Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -935,7 +935,7 @@ def create_gradio_interface(model_path: str, default_max_tokens: int = 8192, att
|
|
| 935 |
|
| 936 |
# Gradio 6.0+ moved theme/css to launch()
|
| 937 |
with gr.Blocks(title="VibeVoice ASR Demo") as demo:
|
| 938 |
-
gr.Markdown("# 🎙️ VibeVoice ASR Demo")
|
| 939 |
gr.Markdown("Upload audio files or record from microphone to get speech-to-text transcription with speaker diarization.")
|
| 940 |
gr.Markdown(f"**Model loaded from:** `{model_path}`")
|
| 941 |
|
|
@@ -956,7 +956,8 @@ def create_gradio_interface(model_path: str, default_max_tokens: int = 8192, att
|
|
| 956 |
do_sample_checkbox = gr.Checkbox(
|
| 957 |
value=False,
|
| 958 |
label="Enable Sampling",
|
| 959 |
-
info="Enable random sampling instead of deterministic decoding"
|
|
|
|
| 960 |
)
|
| 961 |
|
| 962 |
with gr.Column(visible=False) as sampling_params:
|
|
@@ -966,7 +967,8 @@ def create_gradio_interface(model_path: str, default_max_tokens: int = 8192, att
|
|
| 966 |
value=0.0,
|
| 967 |
step=0.1,
|
| 968 |
label="Temperature",
|
| 969 |
-
info="0 = greedy, higher = more random"
|
|
|
|
| 970 |
)
|
| 971 |
top_p_slider = gr.Slider(
|
| 972 |
minimum=0.0,
|
|
@@ -974,7 +976,8 @@ def create_gradio_interface(model_path: str, default_max_tokens: int = 8192, att
|
|
| 974 |
value=1.0,
|
| 975 |
step=0.05,
|
| 976 |
label="Top-p (Nucleus Sampling)",
|
| 977 |
-
info="1.0 = no filtering"
|
|
|
|
| 978 |
)
|
| 979 |
|
| 980 |
# Repetition penalty (works with both greedy and sampling)
|
|
@@ -984,7 +987,8 @@ def create_gradio_interface(model_path: str, default_max_tokens: int = 8192, att
|
|
| 984 |
value=1.0,
|
| 985 |
step=0.01,
|
| 986 |
label="Repetition Penalty",
|
| 987 |
-
info="1.0 = no penalty, higher = less repetition (works with greedy & sampling)"
|
|
|
|
| 988 |
)
|
| 989 |
|
| 990 |
# Context information section
|
|
@@ -1098,24 +1102,24 @@ def create_gradio_interface(model_path: str, default_max_tokens: int = 8192, att
|
|
| 1098 |
queue=False
|
| 1099 |
)
|
| 1100 |
|
| 1101 |
-
# Add examples
|
| 1102 |
-
gr.Markdown("## 📋 Instructions")
|
| 1103 |
-
gr.Markdown(f"""
|
| 1104 |
-
1. **Upload Audio**: Use the audio component to upload a file or record from microphone
|
| 1105 |
-
|
| 1106 |
-
|
| 1107 |
-
2. **Context Info (Optional)**: Provide context to improve transcription accuracy
|
| 1108 |
-
|
| 1109 |
-
|
| 1110 |
-
|
| 1111 |
-
3. **Adjust Parameters**: Configure generation parameters as needed
|
| 1112 |
-
4. **Transcribe**: Click "Transcribe" to get results
|
| 1113 |
-
5. **Review Results**:
|
| 1114 |
-
|
| 1115 |
-
|
| 1116 |
-
|
| 1117 |
-
**Audio Segments**: Each segment shows the time range, speaker ID, transcribed content, and an embedded audio player for immediate verification.
|
| 1118 |
-
""")
|
| 1119 |
|
| 1120 |
return demo, custom_css
|
| 1121 |
|
|
|
|
| 935 |
|
| 936 |
# Gradio 6.0+ moved theme/css to launch()
|
| 937 |
with gr.Blocks(title="VibeVoice ASR Demo") as demo:
|
| 938 |
+
gr.Markdown("# 🎙️ VibeVoice ASR Demo(VibeVoice自動語音辨識)")
|
| 939 |
gr.Markdown("Upload audio files or record from microphone to get speech-to-text transcription with speaker diarization.")
|
| 940 |
gr.Markdown(f"**Model loaded from:** `{model_path}`")
|
| 941 |
|
|
|
|
| 956 |
do_sample_checkbox = gr.Checkbox(
|
| 957 |
value=False,
|
| 958 |
label="Enable Sampling",
|
| 959 |
+
info="Enable random sampling instead of deterministic decoding",
|
| 960 |
+
visible=False
|
| 961 |
)
|
| 962 |
|
| 963 |
with gr.Column(visible=False) as sampling_params:
|
|
|
|
| 967 |
value=0.0,
|
| 968 |
step=0.1,
|
| 969 |
label="Temperature",
|
| 970 |
+
info="0 = greedy, higher = more random",
|
| 971 |
+
visible=False
|
| 972 |
)
|
| 973 |
top_p_slider = gr.Slider(
|
| 974 |
minimum=0.0,
|
|
|
|
| 976 |
value=1.0,
|
| 977 |
step=0.05,
|
| 978 |
label="Top-p (Nucleus Sampling)",
|
| 979 |
+
info="1.0 = no filtering",
|
| 980 |
+
visible=False
|
| 981 |
)
|
| 982 |
|
| 983 |
# Repetition penalty (works with both greedy and sampling)
|
|
|
|
| 987 |
value=1.0,
|
| 988 |
step=0.01,
|
| 989 |
label="Repetition Penalty",
|
| 990 |
+
info="1.0 = no penalty, higher = less repetition (works with greedy & sampling)",
|
| 991 |
+
visible=False
|
| 992 |
)
|
| 993 |
|
| 994 |
# Context information section
|
|
|
|
| 1102 |
queue=False
|
| 1103 |
)
|
| 1104 |
|
| 1105 |
+
# # Add examples
|
| 1106 |
+
# gr.Markdown("## 📋 Instructions")
|
| 1107 |
+
# gr.Markdown(f"""
|
| 1108 |
+
# 1. **Upload Audio**: Use the audio component to upload a file or record from microphone
|
| 1109 |
+
# - **Supported formats**: {', '.join(sorted(set([ext.lower() for ext in COMMON_AUDIO_EXTS])))}
|
| 1110 |
+
# - Optionally set **Start/End time** (seconds or hh:mm:ss) to clip before transcription
|
| 1111 |
+
# 2. **Context Info (Optional)**: Provide context to improve transcription accuracy
|
| 1112 |
+
# - Add hotwords, proper nouns, speaker names, or technical terms
|
| 1113 |
+
# - One item per line or comma-separated
|
| 1114 |
+
# - Examples: "John Smith", "OpenAI", "machine learning"
|
| 1115 |
+
# 3. **Adjust Parameters**: Configure generation parameters as needed
|
| 1116 |
+
# 4. **Transcribe**: Click "Transcribe" to get results
|
| 1117 |
+
# 5. **Review Results**:
|
| 1118 |
+
# - **Raw Output**: View the model's original output
|
| 1119 |
+
# - **Audio Segments**: Play individual segments directly to verify accuracy
|
| 1120 |
+
|
| 1121 |
+
# **Audio Segments**: Each segment shows the time range, speaker ID, transcribed content, and an embedded audio player for immediate verification.
|
| 1122 |
+
# """)
|
| 1123 |
|
| 1124 |
return demo, custom_css
|
| 1125 |
|