neuralleap commited on
Commit
ea2af5a
1 Parent(s): 7ea637e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -4,7 +4,7 @@ import os
4
  import io
5
 
6
  from faster_whisper import WhisperModel
7
- model_size = "large-v2"
8
  transcripe_model = WhisperModel(model_size, device="cuda", compute_type="float16")
9
 
10
 
@@ -15,7 +15,7 @@ app = FastAPI()
15
  async def create_upload_file(file: UploadFile = File(...)):
16
  try:
17
  # Save the file with a specific name
18
- audio = "inputvoice.mp3"
19
 
20
  with open(file_path, "wb") as f:
21
  f.write(file.file.read())
@@ -23,7 +23,7 @@ async def create_upload_file(file: UploadFile = File(...)):
23
  # Read the content of the saved file
24
  #with open(file_path, "rb") as f:
25
  #file_content = f.read()
26
- segments, info = transcripe_model.transcribe(audio, beam_size=5)
27
 
28
  print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
29
  result = ""
 
4
  import io
5
 
6
  from faster_whisper import WhisperModel
7
+ model_size = "large-v3"
8
  transcripe_model = WhisperModel(model_size, device="cuda", compute_type="float16")
9
 
10
 
 
15
  async def create_upload_file(file: UploadFile = File(...)):
16
  try:
17
  # Save the file with a specific name
18
+ file_path = "inputvoice.mp3"
19
 
20
  with open(file_path, "wb") as f:
21
  f.write(file.file.read())
 
23
  # Read the content of the saved file
24
  #with open(file_path, "rb") as f:
25
  #file_content = f.read()
26
+ segments, info = transcripe_model.transcribe(file_path, beam_size=5)
27
 
28
  print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
29
  result = ""