Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,14 +37,14 @@ def transcribe(data):
|
|
| 37 |
print(audio_string)
|
| 38 |
decode_string = base64.b64decode(audio_string)
|
| 39 |
#array = np.frombuffer(decode_string, dtype=np.uint8)
|
| 40 |
-
output_file_path = "audio.wav"
|
| 41 |
-
with open(output_file_path, "wb") as output_file:
|
| 42 |
-
output_file.write(decode_string)
|
| 43 |
|
| 44 |
-
with torch.cuda.amp.autocast():
|
| 45 |
-
data,samplerate = librosa.load(output_file_path)
|
| 46 |
-
text = pipe(data,max_new_tokens=255)["text"]
|
| 47 |
-
|
| 48 |
|
| 49 |
#hf_writer = gr.HuggingFaceDatasetSaver(hf_token = api_key,dataset_name="interaction-log2")
|
| 50 |
|
|
|
|
| 37 |
print(audio_string)
|
| 38 |
decode_string = base64.b64decode(audio_string)
|
| 39 |
#array = np.frombuffer(decode_string, dtype=np.uint8)
|
| 40 |
+
#output_file_path = "audio.wav"
|
| 41 |
+
#with open(output_file_path, "wb") as output_file:
|
| 42 |
+
#output_file.write(decode_string)
|
| 43 |
|
| 44 |
+
#with torch.cuda.amp.autocast():
|
| 45 |
+
#data,samplerate = librosa.load(output_file_path)
|
| 46 |
+
#text = pipe(data,max_new_tokens=255)["text"]
|
| 47 |
+
return audio_string
|
| 48 |
|
| 49 |
#hf_writer = gr.HuggingFaceDatasetSaver(hf_token = api_key,dataset_name="interaction-log2")
|
| 50 |
|