Thong Nguyen commited on
Commit
c1b1966
1 Parent(s): 3d2e8a9

Upload file

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -7,14 +7,9 @@ model = whisper.load_model("base")
7
 
8
 
9
  def video_to_text(video_file):
10
- temp_dir = tempfile.mkdtemp()
11
- video_path = os.path.join(temp_dir, "input_video.mp4")
12
-
13
- with open(video_path, 'wb') as f:
14
- f.write(video_file.read())
15
-
16
  transcription = model.transcribe(video_path)
17
- os.remove(video_path)
18
  return transcription['text']
19
 
20
 
 
7
 
8
 
9
  def video_to_text(video_file):
10
+ video_path = video_file.name
 
 
 
 
 
11
  transcription = model.transcribe(video_path)
12
+
13
  return transcription['text']
14
 
15