Currently, this project uses an asynchronous approach for both image and markdown translations. This process breaks down long documents into smaller chunks based on token count for translation and then merges them back together. However, I've noticed an issue where some chunks are lost during translation, likely due to timeout errors. This results in incomplete translations and inconsistencies in the final output.
Cause
The issue seems to be related not to the length of the document but to the fact that some chunks are not properly received due to timeout errors during the asynchronous processing. When a chunk is not fully translated within a certain time frame, it can cause the subsequent chunks to be processed incorrectly or skipped altogether.
Solution
To address this, I plan to switch markdown translation to synchronous processing and implement a try-catch mechanism. This approach will ensure that each chunk is fully translated and received before moving on to the next.
This issue was discussed with @leestott and suggested as an improvement to move to synchronous processing with a try catch so if chunk x does complete don't move to chunk y and provide a error
Description
Currently, this project uses an asynchronous approach for both image and markdown translations. This process breaks down long documents into smaller chunks based on token count for translation and then merges them back together. However, I've noticed an issue where some chunks are lost during translation, likely due to timeout errors. This results in incomplete translations and inconsistencies in the final output.
Cause
The issue seems to be related not to the length of the document but to the fact that some chunks are not properly received due to timeout errors during the asynchronous processing. When a chunk is not fully translated within a certain time frame, it can cause the subsequent chunks to be processed incorrectly or skipped altogether.
Solution
To address this, I plan to switch markdown translation to synchronous processing and implement a try-catch mechanism. This approach will ensure that each chunk is fully translated and received before moving on to the next.
This issue was discussed with @leestott and suggested as an improvement to move to synchronous processing with a try catch so if chunk
x
does complete don't move to chunky
and provide a error