I receive this error when trying to use IBM Watson. Maybe someone has the same problem - or even better - a solution?
Traceback (most recent call last): File "MY FILE.py", line 27, in service.recognize( File "C:\Users\...\lib\site-packages\ibm_watson\speech_to_text_v1.py", line 566, in recognize response = self.send(request) File "C:\Users\....\lib\site-packages\ibm_cloud_sdk_core\base_service.py", line 308, in send raise ApiException(response.status_code, http_response=response) ibm_cloud_sdk_core.api_exception.ApiException: Error: Internal Server Error Internal Server Error - Write The server encountered an internal error or misconfiguration and was unable to complete your request.Reference #4.a54a0760.1627114991.5298a594 , Code: 503
Here is the code I am using
# Accepts only .mp3 Format of Audio # File import json from os.path import join, dirname from ibm_watson import SpeechToTextV1 from ibm_watson.websocket import RecognizeCallback, AudioSource from ibm_cloud_sdk_core.authenticators import IAMAuthenticator # Insert API Key in place of # YOUR UNIQUE API KEY - I replaced this text with my API KEY in actual code authenticator = IAMAuthenticator('YOUR UNIQUE API KEY') service = SpeechToTextV1(authenticator = authenticator) #Insert URL in place of API_URL - below is actual I am using service.set_service_url('https://api.us-east.speech-to-text.watson.cloud.ibm.com') # Insert local mp3 file path in # place of LOCAL FILE PATH - I am using my C drive and replaced actual file path ending with open(join(dirname('__file__'), r'C:/Users/LOCAL FILE PATH.mp3'), 'rb') as audio_file: dic = json.loads( json.dumps( service.recognize( audio=audio_file, content_type='audio/flac', model='en-US_NarrowbandModel', continuous=True).get_result(), indent=2)) # Stores the transcribed text str = "" while bool(dic.get('results')): str = dic.get('results').pop().get('alternatives').pop().get('transcript')+str[:] print(str)