Spaces:
Build error
Build error
Kartikeyssj2
commited on
Commit
•
9cc016d
1
Parent(s):
cbb980c
Update main.py
Browse files
main.py
CHANGED
@@ -107,7 +107,6 @@ async def upload_audio(file: UploadFile = File(...)):
|
|
107 |
|
108 |
print("audio:" , audio[:5])
|
109 |
|
110 |
-
return "audio sample extracted:"
|
111 |
|
112 |
|
113 |
print("length of the audio array:" , len(audio))
|
@@ -120,7 +119,7 @@ async def upload_audio(file: UploadFile = File(...)):
|
|
120 |
audio,
|
121 |
return_tensors="pt",
|
122 |
padding="max_length",
|
123 |
-
max_length=
|
124 |
truncation=True
|
125 |
).input_values
|
126 |
|
@@ -128,6 +127,8 @@ async def upload_audio(file: UploadFile = File(...)):
|
|
128 |
|
129 |
print("Tokenization complete. Shape of input_values:", input_values.shape)
|
130 |
|
|
|
|
|
131 |
# Perform inference
|
132 |
print("Performing inference with Wav2Vec2 model...")
|
133 |
|
|
|
107 |
|
108 |
print("audio:" , audio[:5])
|
109 |
|
|
|
110 |
|
111 |
|
112 |
print("length of the audio array:" , len(audio))
|
|
|
119 |
audio,
|
120 |
return_tensors="pt",
|
121 |
padding="max_length",
|
122 |
+
max_length= 386380,
|
123 |
truncation=True
|
124 |
).input_values
|
125 |
|
|
|
127 |
|
128 |
print("Tokenization complete. Shape of input_values:", input_values.shape)
|
129 |
|
130 |
+
return "tokenization successful"
|
131 |
+
|
132 |
# Perform inference
|
133 |
print("Performing inference with Wav2Vec2 model...")
|
134 |
|