API преобразования речи в текст облака Google отлично работает, когда я отправляю запросы для одного или нескольких аудиофайлов. Но когда корпус данных отправляется в "google.cloud.speech_v1", я получаю ошибку "google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded".
for index, row in indian_df.iterrows():
src = "/home/malkaiv/project/Datasets/common-voice/cv-valid-train" + row['filename']
sample_long_running_recognize(src)
#next trying to store response from sample_long_running_recognize() from google.cloud.speech_v1 api
размер фрейма данных indian_df (4490 , 8)
фактическая ошибка:
Traceback (most recent call last):
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/grpc/_channel.py", line 826, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/grpc/_channel.py", line 729, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.DEADLINE_EXCEEDED
details = "Deadline Exceeded"
debug_error_string = "{"created":"@1588677365.213299508","description":"Error received from peer ipv4:172.217.6.202:443","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"Deadline Exceeded","grpc_status":4}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "dataframes.py", line 25, in <module>
sample_long_running_recognize(src, False)
File "/home/malkaiv/project/dataprocess.py", line 57, in sample_long_running_recognize
response = operation.result()
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/future/polling.py", line 125, in result
self._blocking_poll(timeout=timeout)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/future/polling.py", line 104, in _blocking_poll
retry_(self._done_or_raise)()
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
on_error=on_error,
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/future/polling.py", line 83, in _done_or_raise
if not self.done():
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/operation.py", line 169, in done
self._refresh_and_update(retry)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/operation.py", line 157, in _refresh_and_update
self._operation = self._refresh(retry=retry)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/operations_v1/operations_client.py", line 131, in get_operation
return self._get_operation(request, retry=retry, timeout=timeout)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
return wrapped_func(*args, **kwargs)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
on_error=on_error,
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
return func(*args, **kwargs)
File "/home/malkaiv/anaconda3/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "<string>", line 3, in raise_from
google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded
Кто-нибудь, пожалуйста, дайте мне способ получить ответ от 'sample_long_running_recognize' для всех файлов во фрейме данных.