Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,14 +33,13 @@ def transcribe(data):
|
|
| 33 |
#data_dict=ast.literal_eval(data)
|
| 34 |
#data_list= data["data"]
|
| 35 |
#url = data_list[0]
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
#decode_string = base64.b64decode(audio_string)
|
| 39 |
#array = np.frombuffer(decode_string, dtype=np.uint8)
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
#with torch.cuda.amp.autocast():
|
| 45 |
#data,samplerate = librosa.load(output_file_path)
|
| 46 |
#text = pipe(output_file_path,max_new_tokens=255)["text"]
|
|
|
|
| 33 |
#data_dict=ast.literal_eval(data)
|
| 34 |
#data_list= data["data"]
|
| 35 |
#url = data_list[0]
|
| 36 |
+
#url["url"]
|
| 37 |
+
decode_string = base64.b64decode(data)
|
|
|
|
| 38 |
#array = np.frombuffer(decode_string, dtype=np.uint8)
|
| 39 |
+
output_file_path = "audio.wav"
|
| 40 |
+
with open(output_file_path, "wb") as output_file:
|
| 41 |
+
output_file.write(decode_string)
|
| 42 |
+
return "Success"
|
| 43 |
#with torch.cuda.amp.autocast():
|
| 44 |
#data,samplerate = librosa.load(output_file_path)
|
| 45 |
#text = pipe(output_file_path,max_new_tokens=255)["text"]
|