mjavaid commited on
Commit
2567c58
·
1 Parent(s): 62e9e39

first commit

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -13,6 +13,7 @@ model_id = "CohereForAI/aya-vision-8b"
13
  processor = None
14
  model = None
15
 
 
16
  def load_model():
17
  global processor, model
18
  if processor is None or model is None:
@@ -25,6 +26,7 @@ def load_model():
25
  except Exception as e:
26
  return f"Error loading model: {e}\nMake sure to install the correct version of transformers with: pip install 'git+https://github.com/huggingface/[email protected]'"
27
  return "Model already loaded!"
 
28
  @spaces.GPU
29
  def process_image_and_prompt(image, image_url, prompt, temperature=0.3, max_tokens=300):
30
  global processor, model
 
13
  processor = None
14
  model = None
15
 
16
+ @spaces.GPU
17
  def load_model():
18
  global processor, model
19
  if processor is None or model is None:
 
26
  except Exception as e:
27
  return f"Error loading model: {e}\nMake sure to install the correct version of transformers with: pip install 'git+https://github.com/huggingface/[email protected]'"
28
  return "Model already loaded!"
29
+
30
  @spaces.GPU
31
  def process_image_and_prompt(image, image_url, prompt, temperature=0.3, max_tokens=300):
32
  global processor, model