product2204 commited on
Commit
c267bd8
·
verified ·
1 Parent(s): c4bc9a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -20,8 +20,7 @@ def extract_audio(video_path):
20
  clip.write_audiofile(audio_path)
21
  return audio_path
22
 
23
- def transcribe_audio(audio_path, api_key):
24
- os.environ["DEEPGRAM_API_KEY"] = api_key
25
  # Environment Setup (Ensure environment variables are set appropriately)
26
  load_dotenv()
27
  # Deepgram API Key Setup
@@ -63,7 +62,9 @@ def transcribe_audio(audio_path, api_key):
63
  def process_video(video_url, api_key):
64
  video_path = download_video(video_url)
65
  audio_path = extract_audio(video_path)
66
- transcription = transcribe_audio(audio_path, api_key)
 
 
67
  return transcription
68
 
69
  # Define Gradio interface
 
20
  clip.write_audiofile(audio_path)
21
  return audio_path
22
 
23
+ def transcribe_audio(audio_path):
 
24
  # Environment Setup (Ensure environment variables are set appropriately)
25
  load_dotenv()
26
  # Deepgram API Key Setup
 
62
  def process_video(video_url, api_key):
63
  video_path = download_video(video_url)
64
  audio_path = extract_audio(video_path)
65
+ os.environ["DEEPGRAM_API_KEY"] = api_key
66
+ transcription = transcribe_audio(audio_path)
67
+
68
  return transcription
69
 
70
  # Define Gradio interface