Malaji71 commited on
Commit
830576d
·
verified ·
1 Parent(s): b5c60a9

Update models.py

Browse files
Files changed (1) hide show
  1. models.py +2 -1
models.py CHANGED
@@ -3,8 +3,8 @@ Model management for Frame 0 Laboratory for MIA
3
  BAGEL 7B integration via API calls
4
  """
5
 
 
6
  import logging
7
- import tempfile
8
  import os
9
  from typing import Optional, Dict, Any, Tuple
10
  from PIL import Image
@@ -88,6 +88,7 @@ class BagelAPIAnalyzer(BaseImageAnalyzer):
88
  except Exception as e:
89
  logger.warning(f"Failed to cleanup temp file: {e}")
90
 
 
91
  def analyze_image(self, image: Image.Image, prompt: str = None) -> Tuple[str, Dict[str, Any]]:
92
  """Analyze image using BAGEL API"""
93
  if not self.is_initialized:
 
3
  BAGEL 7B integration via API calls
4
  """
5
 
6
+ import spaces
7
  import logging
 
8
  import os
9
  from typing import Optional, Dict, Any, Tuple
10
  from PIL import Image
 
88
  except Exception as e:
89
  logger.warning(f"Failed to cleanup temp file: {e}")
90
 
91
+ @spaces.GPU(duration=60)
92
  def analyze_image(self, image: Image.Image, prompt: str = None) -> Tuple[str, Dict[str, Any]]:
93
  """Analyze image using BAGEL API"""
94
  if not self.is_initialized: