Kartikeyssj2 commited on
Commit
5f74423
1 Parent(s): c34b637

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -1
main.py CHANGED
@@ -109,7 +109,16 @@ async def upload_audio(file: UploadFile = File(...)):
109
 
110
  # Tokenization
111
  print("Tokenizing audio...")
112
- input_values = await asyncio.to_thread(tokenizer, audio, return_tensors="pt")
 
 
 
 
 
 
 
 
 
113
  input_values = input_values.input_values
114
  print("Tokenization complete. Shape of input_values:", input_values.shape)
115
 
 
109
 
110
  # Tokenization
111
  print("Tokenizing audio...")
112
+ input_values = tokenizer(
113
+ audio,
114
+ return_tensors="pt",
115
+ padding="max_length",
116
+ max_length= 1000000,
117
+ truncation=True
118
+ ).input_values
119
+
120
+ print(input_values.shape)
121
+
122
  input_values = input_values.input_values
123
  print("Tokenization complete. Shape of input_values:", input_values.shape)
124