gokaygokay commited on
Commit
79ce0f7
1 Parent(s): 71141aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
7
  import subprocess
8
  subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
9
 
10
- model = AutoModelForCausalLM.from_pretrained('gokaygokay/Florence-2-SD3-Captioner', trust_remote_code=True).to("cuda").eval()
11
 
12
  processor = AutoProcessor.from_pretrained('gokaygokay/Florence-2-SD3-Captioner', trust_remote_code=True)
13
 
@@ -53,7 +53,7 @@ def run_example(image):
53
  if image.mode != "RGB":
54
  image = image.convert("RGB")
55
 
56
- inputs = processor(text=prompt, images=image, return_tensors="pt").to("cuda")
57
  generated_ids = model.generate(
58
  input_ids=inputs["input_ids"],
59
  pixel_values=inputs["pixel_values"],
 
7
  import subprocess
8
  subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
9
 
10
+ model = AutoModelForCausalLM.from_pretrained('gokaygokay/Florence-2-SD3-Captioner', trust_remote_code=True).eval()
11
 
12
  processor = AutoProcessor.from_pretrained('gokaygokay/Florence-2-SD3-Captioner', trust_remote_code=True)
13
 
 
53
  if image.mode != "RGB":
54
  image = image.convert("RGB")
55
 
56
+ inputs = processor(text=prompt, images=image, return_tensors="pt")
57
  generated_ids = model.generate(
58
  input_ids=inputs["input_ids"],
59
  pixel_values=inputs["pixel_values"],