bdsqlsz commited on
Commit
e744f2e
1 Parent(s): 716f2ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ import re
4
  from PIL import Image
5
  import os
6
  import numpy as np
7
- import space
8
 
9
  model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to("cuda").eval()
10
  processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
@@ -29,7 +29,7 @@ def modify_caption(caption: str) -> str:
29
 
30
  return merged_content if merged_content != caption else caption
31
 
32
- @space.GPU
33
  def process_image(image):
34
  if isinstance(image, np.ndarray):
35
  image = Image.fromarray(image)
 
4
  from PIL import Image
5
  import os
6
  import numpy as np
7
+ import spaces
8
 
9
  model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to("cuda").eval()
10
  processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
 
29
 
30
  return merged_content if merged_content != caption else caption
31
 
32
+ @spaces.GPU
33
  def process_image(image):
34
  if isinstance(image, np.ndarray):
35
  image = Image.fromarray(image)