Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1246,7 +1246,8 @@ def process_text(api_key,text_file):
|
|
1246 |
def launch_ui(demo_mode=False):
|
1247 |
def process_transcription(json_data):
|
1248 |
if json_data:
|
1249 |
-
return
|
|
|
1250 |
else:
|
1251 |
return ""
|
1252 |
|
@@ -1263,14 +1264,14 @@ def launch_ui(demo_mode=False):
|
|
1263 |
gr.components.Textbox(label="API Key - Have to provide one, unless you're fine waiting on HuggingFace..."),
|
1264 |
# gr.components.Checkbox(value=False, label="Download Video"),
|
1265 |
# gr.components.Checkbox(value=False, label="VAD Filter")
|
1266 |
-
|
1267 |
])
|
1268 |
|
1269 |
iface = gr.Interface(
|
1270 |
fn=lambda *args: process_url(*args, demo_mode=demo_mode),
|
1271 |
inputs=inputs,
|
1272 |
outputs=[
|
1273 |
-
gr.components.Textbox(label="Transcription", value=lambda:
|
|
|
1274 |
gr.components.Textbox(label="Summary or Status Message"),
|
1275 |
gr.components.File(label="Download Transcription as JSON"),
|
1276 |
gr.components.File(label="Download Summary as text", visible=lambda summary_file_path: summary_file_path is not None)
|
@@ -1452,7 +1453,7 @@ if __name__ == "__main__":
|
|
1452 |
parser.add_argument('-wm', '--whisper_model', type=str, default='small.en', help='Whisper model (default: small.en)')
|
1453 |
parser.add_argument('-off', '--offset', type=int, default=0, help='Offset in seconds (default: 0)')
|
1454 |
parser.add_argument('-vad', '--vad_filter', action='store_true', help='Enable VAD filter')
|
1455 |
-
parser.add_argument('-log', '--log_level', type=str, default='
|
1456 |
parser.add_argument('-ui', '--user_interface', action='store_true', help='Launch the Gradio user interface')
|
1457 |
parser.add_argument('-demo', '--demo_mode', action='store_true', help='Enable demo mode')
|
1458 |
#parser.add_argument('--log_file', action=str, help='Where to save logfile (non-default)')
|
|
|
1246 |
def launch_ui(demo_mode=False):
|
1247 |
def process_transcription(json_data):
|
1248 |
if json_data:
|
1249 |
+
return json.dumps(json_data, indent=2)
|
1250 |
+
#return "\n".join([item["text"] for item in json_data])
|
1251 |
else:
|
1252 |
return ""
|
1253 |
|
|
|
1264 |
gr.components.Textbox(label="API Key - Have to provide one, unless you're fine waiting on HuggingFace..."),
|
1265 |
# gr.components.Checkbox(value=False, label="Download Video"),
|
1266 |
# gr.components.Checkbox(value=False, label="VAD Filter")
|
|
|
1267 |
])
|
1268 |
|
1269 |
iface = gr.Interface(
|
1270 |
fn=lambda *args: process_url(*args, demo_mode=demo_mode),
|
1271 |
inputs=inputs,
|
1272 |
outputs=[
|
1273 |
+
gr.components.Textbox(label="Transcription", value=lambda json_data: process_transcription(json_data), max_lines=10),
|
1274 |
+
# gr.components.Textbox(label="Transcription", value=lambda: "", max_lines=10),
|
1275 |
gr.components.Textbox(label="Summary or Status Message"),
|
1276 |
gr.components.File(label="Download Transcription as JSON"),
|
1277 |
gr.components.File(label="Download Summary as text", visible=lambda summary_file_path: summary_file_path is not None)
|
|
|
1453 |
parser.add_argument('-wm', '--whisper_model', type=str, default='small.en', help='Whisper model (default: small.en)')
|
1454 |
parser.add_argument('-off', '--offset', type=int, default=0, help='Offset in seconds (default: 0)')
|
1455 |
parser.add_argument('-vad', '--vad_filter', action='store_true', help='Enable VAD filter')
|
1456 |
+
parser.add_argument('-log', '--log_level', type=str, default='INFO', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Log level (default: INFO)')
|
1457 |
parser.add_argument('-ui', '--user_interface', action='store_true', help='Launch the Gradio user interface')
|
1458 |
parser.add_argument('-demo', '--demo_mode', action='store_true', help='Enable demo mode')
|
1459 |
#parser.add_argument('--log_file', action=str, help='Where to save logfile (non-default)')
|