machinewrapped / gpt-subtrans

Open Source project using LLMs to translate SRT subtitles
Other
347 stars 40 forks source link

Release as a package/library? #37

Open chen-rn opened 1 year ago

chen-rn commented 1 year ago

I think this is the best library I've found for using GPT to do subtitle translation! Great job. A lot of that issues that I ran into while trying to use gpt4 to do translation for subs has been solved(mainly the sync and batching issue).

I'll likely copy the core code from this repo for my own project, but it would be amazing to have a library that I can simply import and update when this package updates(especially given how fast the GPT apis are changing)!

Anyhow, just throwing this out there :) I know you probably got a lot on your plate! Thanks for the great contribution!

machinewrapped commented 1 year ago

Thanks, glad to hear it's been useful!

The PySubtitleGPT folder should be usable as a library, that's basically how the project started life and it contains all the core functionality. It would be good to package it without the GUI or the CLI, but I don't know what the best approach would be. Do you know if there's a way to publish a specific subfolder on PyPi, or something?

I guess forking the repository and deleting the GUI & top-level scripts might work too, though that's probably not how these things are supposed to be done 😅 If you feel like creating/maintaining a library fork then please do so with my blessing though!

chen-rn commented 1 year ago

Yea! The project is well organized, to the point where I can just copy the PySubtitleGPT folder and start using the SubtitleProject class.

I don't know what the best approach would be. Do you know if there's a way to publish a specific subfolder on PyPi, or something?

I would imagine the best way would be to have two separate repos(like what you said), one for the GUI and one for the Library. Your GUI would simply import the Library like how other projects would!

I'm not too familiar publishing Python libraries either but I don't think it'd be too difficult given how well organized the code is atm. I'm sure someone who is more familiar with that will pick up the task in the near future as this seems to be the best gpt-subtitle library! Maybe you can add a "roadmap/contribution.md" in the README for others to pick up:)

zh-plus commented 1 year ago

Perhaps you can use poetry to package your work to pypi. Just put PySubtitleGPT in the packages section, like this: packages = [{include = "PySubtitleGPT"}].

By the way, I am currently working on a project called openlrc that converts speech to text and translates it. Your prompt has given me a lot of inspiration. Great job!

machinewrapped commented 1 year ago

Thanks, Poetry looks promising, I'll investigate it in more detail.

That's great that you're working on a project - good luck with it - and I'm happy to have been inspiring! I'm really excited by the potential of this new generation of AI models, and can't wait to see where things go from here!

machinewrapped commented 3 months ago

I still think this is a good idea, even though the issue is nearly 12 months old and I still haven't done it! If anybody who has Poetry experience would like to tackle it, it would be appreciated - it can probably be done without separating the core library and the GUI into different projects.