lewangdev / autotranslate

Videos Transcription and Translation with Faster Whisper and ChatGPT
Apache License 2.0
234 stars 37 forks source link

How to get model to run on all files when given Google Drive folder path? #6

Closed pikaOne1138 closed 11 months ago

pikaOne1138 commented 12 months ago

I input the folder path of Google Drive, and it also printed out that 64 files were selected. But when I "Run the model", it only runs the last file. How can I adjust or modify this?

lewangdev commented 12 months ago

I am busy today. After reviewing my code, I found that my colab does not support multiple files. However, I made some slight modifications to the code for your reference, enabling it to automatically handle multiple files. It is placed in this branch. I haven't had time to test it yet.

https://github.com/lewangdev/autotranslate/tree/feat/support-multifiles-in-google-drive

You can read and test in colab:

notebook shield

pikaOne1138 commented 12 months ago

I used it today, and it reported an error the first time. I found that there should be no other folders in the target folder, or there will be problems. After that, it ran smoothly, but I put in almost 50 files. I finished the transcripts for the files. I then proceeded to translate them, but after translating two files, Colab was interrupted due to inactivity.

I have a small suggestion. Is it possible to split out part of this project so that it can directly read the SRTs in the folder and translate them?

-- The above English was translated from Chinese using Bard.

lewangdev commented 11 months ago

The srt subtitle file is a different format that cannot be processed by this colab project. The program's logic is to convert the video into audio and then recognize it as an intermediate state of segments, so it is unable to separate out the logic for handling srt separately.