oceansweep commited on
Commit
5d456da
·
verified ·
1 Parent(s): 22ae4b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -340,7 +340,7 @@ def process_local_file(file_path):
340
  # Video Download/Handling
341
  #
342
 
343
- def process_url(input_path, num_speakers=2, whisper_model="small.en", offset=0, api_name=None, api_key=None, vad_filter=False, download_video_flag=False, demo_mode=False):
344
  if demo_mode:
345
  api_name = "huggingface"
346
  api_key = os.environ.get("HF_TOKEN")
@@ -1153,6 +1153,8 @@ def save_summary_to_file(summary, file_path):
1153
  # Only to be used when configured with Gradio for HF Space
1154
  def summarize_with_huggingface(api_key, file_path):
1155
  logging.debug(f"huggingface: Summarization process starting...")
 
 
1156
  try:
1157
  logging.debug("huggingface: Loading json data for summarization")
1158
  with open(file_path, 'r') as file:
@@ -1202,7 +1204,7 @@ def launch_ui(demo_mode=False):
1202
  else:
1203
  return ""
1204
 
1205
- # dropdown.change(None, dropdown, None, _js=js)
1206
  # toggle_dark.click(
1207
  # None,
1208
  # _js="""
@@ -1240,8 +1242,9 @@ def launch_ui(demo_mode=False):
1240
  title="Video Transcription and Summarization",
1241
  description="Submit a video URL for transcription and summarization.",
1242
  allow_flagging="never",
1243
- theme='bethecloud/storj_theme'
1244
  # FIXME - Figure out how to enable dark mode...
 
1245
  )
1246
 
1247
  iface.launch(share=True)
 
340
  # Video Download/Handling
341
  #
342
 
343
+ def process_url(input_path, num_speakers=2, whisper_model="small.en", offset=0, api_name=None, api_key=None, vad_filter=False, download_video_flag=False, demo_mode=True):
344
  if demo_mode:
345
  api_name = "huggingface"
346
  api_key = os.environ.get("HF_TOKEN")
 
1153
  # Only to be used when configured with Gradio for HF Space
1154
  def summarize_with_huggingface(api_key, file_path):
1155
  logging.debug(f"huggingface: Summarization process starting...")
1156
+ if api_key == "":
1157
+ api_key = os.environ.get("HF_TOKEN")
1158
  try:
1159
  logging.debug("huggingface: Loading json data for summarization")
1160
  with open(file_path, 'r') as file:
 
1204
  else:
1205
  return ""
1206
 
1207
+ # dropdown.change(None, dropdown, None, _js=js)
1208
  # toggle_dark.click(
1209
  # None,
1210
  # _js="""
 
1242
  title="Video Transcription and Summarization",
1243
  description="Submit a video URL for transcription and summarization.",
1244
  allow_flagging="never",
1245
+ theme="bethecloud/storj_theme"
1246
  # FIXME - Figure out how to enable dark mode...
1247
+ # other themes: https://huggingface.co/spaces/gradio/theme-gallery
1248
  )
1249
 
1250
  iface.launch(share=True)