LLDDWW commited on
Commit
69a39af
Β·
1 Parent(s): e8a6e3f

chore: mark vision analysis for gpu execution

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -4,6 +4,7 @@ from typing import Any, Dict, List, Optional
4
 
5
  import gradio as gr
6
  import torch
 
7
  from PIL import Image, ImageDraw
8
  from transformers import AutoModelForVision2Seq, AutoProcessor
9
 
@@ -121,6 +122,7 @@ def _parse_vl_response(text: str) -> Dict[str, Any]:
121
  }
122
 
123
 
 
124
  def analyze_image_with_qwen(image: Image.Image) -> Dict[str, Any]:
125
  instructions = (
126
  "사진 속 μ•½λ΄‰νˆ¬/μ²˜λ°©μ „μ„ 읽고 μ•„λž˜ JSON ν˜•μ‹μœΌλ‘œλ§Œ λ‹΅λ³€ν•˜μ„Έμš”. "
 
4
 
5
  import gradio as gr
6
  import torch
7
+ import spaces
8
  from PIL import Image, ImageDraw
9
  from transformers import AutoModelForVision2Seq, AutoProcessor
10
 
 
122
  }
123
 
124
 
125
+ @spaces.GPU(enable_queue=True)
126
  def analyze_image_with_qwen(image: Image.Image) -> Dict[str, Any]:
127
  instructions = (
128
  "사진 속 μ•½λ΄‰νˆ¬/μ²˜λ°©μ „μ„ 읽고 μ•„λž˜ JSON ν˜•μ‹μœΌλ‘œλ§Œ λ‹΅λ³€ν•˜μ„Έμš”. "