Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add 'Improve Caption' functionality using Ollama
This commit introduces a new feature that allows users to improve their image captions using the Ollama language model. - Added an 'Improve Caption' button to the UI, which triggers an asynchronous background task to process the current caption and image using Ollama's llama3.2-vision model. - Implemented ImproveCaptionTask (QRunnable) to handle the Ollama API interaction and process the improvement request in a separate thread, preventing UI freezes. - Enhanced the UI with status updates during the improvement process, including disabling/enabling the button and displaying messages. - Improved error handling to provide more informative messages to the user in case of failures. - The improved caption is now appended to the text edit with a clear separator ('Improved Version:'), making it easy to compare the original and improved captions. - The prompt sent to Ollama is more explicit, instructing the model to 'improve or rewrite' the provided caption based on the image context. - Handles cases where the caption is empty or no image is selected.
- Loading branch information