Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message in audio transcription with large files. #89

Open
mapson01 opened this issue Apr 18, 2024 · 6 comments
Open

Error message in audio transcription with large files. #89

mapson01 opened this issue Apr 18, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@mapson01
Copy link

Which version of integration_openai are you using?

2.0.0

Which version of Nextcloud are you using?

28.0.2

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

firefox, chrome

Describe the Bug

Transcribe audio to text produce error if audio file is longer more than 6 min (11 mb aprox). Checking the LocalAI debug there is no prompt request with larger files (11mb). It is seem's an Assistant issue.

Expected Behavior

The expected behavior idealy is to return the complete text. if there is a Assitant limitation show a message saying so. The workaround is to split the original file in "workable" chunks... process it and return the concatenated text of every result.

To Reproduce

Try to trancribe a large audio file more than 10 min.

@mapson01 mapson01 added the bug Something isn't working label Apr 18, 2024
@kyteinsky
Copy link
Contributor

Hello, do you have server logs for this error?

@mapson01
Copy link
Author

Yes! sorry i forgot to include the log.
it reveal a 413 Request Entity Too Large but nothing shown in LocalAi debug.
cheers.

{"reqId":"t3osM9mo6Tet48DheHS2","level":2,"time":"2024-04-19T13:20:04+00:00","remoteAddr":"","user":"--","app":"integration_openai","method":"","url":"--","message":"API request error : Client error: POST http://192.168.8.13:8880/v1/audio/transcriptions resulted in a 413 Request Entity Too Large response:\n{"error":{"code":413,"message":"Request Entity Too Large","type":""}}\n","userAgent":"--","version":"28.0.4.1","exception":{"Exception":"GuzzleHttp\Exception\ClientException","Message":"Client error: POST http://192.168.8.13:8880/v1/audio/transcriptions resulted in a 413 Request Entity Too Large response:\n{"error":{"code":413,"message":"Request Entity Too Large","type":""}}\n","Code":413,"Trace":[{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":69,"function":"create","class":"GuzzleHttp\Exception\RequestException","type":"::","args":["*** sensitive parameters replaced "]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":204,"function":"GuzzleHttp\{closure}","class":"GuzzleHttp\Middleware","type":"::","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":153,"function":"callHandler","class":"GuzzleHttp\Promise\Promise","type":"::"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":48,"function":"GuzzleHttp\Promise\{closure}","class":"GuzzleHttp\Promise\Promise","type":"::","args":[" sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":248,"function":"run","class":"GuzzleHttp\Promise\TaskQueue","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"wait","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/lib/private/Http/Client/Client.php","line":301,"function":"request","class":"GuzzleHttp\Client","type":"->"},{"file":"/var/www/nextcloud/apps/integration_openai/lib/Service/OpenAiAPIService.php","line":682,"function":"post","class":"OC\Http\Client\Client","type":"->"},{"file":"/var/www/nextcloud/apps/integration_openai/lib/Service/OpenAiAPIService.php","line":456,"function":"request","class":"OCA\OpenAi\Service\OpenAiAPIService","type":"->"},{"file":"/var/www/nextcloud/apps/integration_openai/lib/Service/OpenAiAPIService.php","line":420,"function":"transcribe","class":"OCA\OpenAi\Service\OpenAiAPIService","type":"->"},{"file":"/var/www/nextcloud/apps/integration_openai/lib/SpeechToText/STTProvider.php","line":38,"function":"transcribeFile","class":"OCA\OpenAi\Service\OpenAiAPIService","type":"->"},{"file":"/var/www/nextcloud/lib/private/SpeechToText/SpeechToTextManager.php","line":129,"function":"transcribeFile","class":"OCA\OpenAi\SpeechToText\STTProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/SpeechToText/TranscriptionJob.php","line":82,"function":"transcribeFile","class":"OC\SpeechToText\SpeechToTextManager","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OC\SpeechToText\TranscriptionJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":57,"function":"start","class":"OCP\BackgroundJob\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":47,"function":"start","class":"OCP\BackgroundJob\QueuedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OCP\BackgroundJob\QueuedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"message":"API request error : Client error: POST http://192.168.8.13:8880/v1/audio/transcriptions resulted in a 413 Request Entity Too Large response:\n{"error":{"code":413,"message":"Request Entity Too Large","type":""}}\n","response_body":{},"exception":{},"CustomMessage":"API request error : Client error: POST http://192.168.8.13:8880/v1/audio/transcriptions resulted in a 413 Request Entity Too Large response:\n{"error":{"code":413,"message":"Request Entity Too Large","type":""}}\n"}}

@kyteinsky
Copy link
Contributor

Can you verify your php.ini settings has good values for post_max_size and upload_max_filesize? 512M is a good default size but can depend on your use case. You may also adjust the timeout of the uploads. More info here: https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html

@mapson01
Copy link
Author

Yes both post_max_size and upload_max_filesize are set to 4G, max_execution_time and max_input_time was 30, i change it to 3600 acording to documentation, restart and still same error.

@marcelklehr
Copy link
Member

The 413 status is coming from localAI I think, see mudler/LocalAI#1733

@mapson01
Copy link
Author

Tnks kyteinsky and marcelklehr for your quick answers. In debug mode localAI does not show me any message about this error but yes it seems to come from it. As exposed in mudler/LocalAI#1733 even whisper-v3 accept larger files but it also seems to have limitations, that lead me to the idea i said before to split the audio files in "chunks", process one by one and concatenate the result, something like:

sox orig.wav p.wav silence -l 0 1 0.5 0.1% : newfile : restart #split on silence detection... just an idea!

Meanwhile, it will be very usefull a message to the end user in Nextcloud Assistant explaining that it is a limitation.
Last and strictly speaking, it seems to be a localAI problem so I think this thread can be closed.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants