take turns using the GPU
This commit is contained in:
@@ -158,6 +158,16 @@ class ProcessingWorkflow:
|
||||
logger.error("Whisper is not installed. Install it with: pip install openai-whisper")
|
||||
raise RuntimeError("Whisper not installed")
|
||||
|
||||
# Unload Ollama model to free GPU memory for Whisper (if using vision)
|
||||
if self.config.use_vision:
|
||||
logger.info("Freeing GPU memory for Whisper...")
|
||||
try:
|
||||
subprocess.run(["ollama", "stop", self.config.vision_model],
|
||||
capture_output=True, check=False)
|
||||
logger.info("✓ Ollama model unloaded")
|
||||
except Exception as e:
|
||||
logger.warning(f"Could not unload Ollama model: {e}")
|
||||
|
||||
logger.info(f"Running Whisper transcription (model: {self.config.whisper_model})...")
|
||||
logger.info("This may take a few minutes depending on video length...")
|
||||
|
||||
@@ -224,6 +234,7 @@ class ProcessingWorkflow:
|
||||
def _run_vision_analysis(self, frames_info):
|
||||
"""Run vision analysis on frames."""
|
||||
logger.info("Step 2: Running vision analysis on extracted frames...")
|
||||
logger.info(f"Loading vision model {self.config.vision_model} to GPU...")
|
||||
|
||||
try:
|
||||
vision = VisionProcessor(model=self.config.vision_model)
|
||||
|
||||
Reference in New Issue
Block a user