LLDDWW commited on
Commit
84e5d9f
Β·
1 Parent(s): 98b216f

fix: change to VL-7B for ZeroGPU compatibility

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -15,8 +15,8 @@ from transformers import (
15
  AutoProcessor,
16
  )
17
 
18
- # 단일 λͺ¨λΈλ‘œ λͺ¨λ“  μž‘μ—… μˆ˜ν–‰
19
- VL_MODEL_ID = "Qwen/Qwen2.5-VL-32B-Instruct"
20
 
21
 
22
  def search_drug_web_simple(drug_name: str) -> str:
@@ -63,9 +63,9 @@ DEFAULT_FONT = _load_font()
63
 
64
 
65
  def _load_vl_model():
66
- """단일 VL λͺ¨λΈ λ‘œλ“œ - λͺ¨λ“  μž‘μ—…μ— μ‚¬μš©"""
67
  device_map = "auto" if torch.cuda.is_available() else None
68
- dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
69
 
70
  model = AutoModelForVision2Seq.from_pretrained(
71
  VL_MODEL_ID,
@@ -80,7 +80,7 @@ def _load_vl_model():
80
  return model, processor
81
 
82
 
83
- print("πŸ”„ Loading Qwen2.5-VL-32B model...")
84
  VL_MODEL, VL_PROCESSOR = _load_vl_model()
85
  print("βœ… Model loaded successfully!")
86
 
@@ -675,7 +675,7 @@ HERO_HTML = """
675
  <h1>πŸ₯ MedCard Pro</h1>
676
  <p>
677
  <strong>AI 기반 슀마트 μ•½λ¬Ό 관리 μ‹œμŠ€ν…œ</strong><br>
678
- Qwen2.5-VL-32Bκ°€ μ•½λ΄‰νˆ¬λ₯Ό μ •ν™•νžˆ λΆ„μ„ν•˜κ³ , μ›Ήμ—μ„œ μ‹€μ‹œκ°„μœΌλ‘œ 정보λ₯Ό κ²€μ¦ν•˜μ—¬<br>
679
  μ–΄λ₯΄μ‹ κ³Ό 어린이 λͺ¨λ‘κ°€ 이해할 수 μžˆλŠ” λ§žμΆ€ν˜• 볡약 μ•ˆλ‚΄λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.
680
  </p>
681
  </div>
 
15
  AutoProcessor,
16
  )
17
 
18
+ # 단일 λͺ¨λΈλ‘œ λͺ¨λ“  μž‘μ—… μˆ˜ν–‰ (ZeroGPU ν˜Έν™˜)
19
+ VL_MODEL_ID = "Qwen/Qwen2.5-VL-7B-Instruct"
20
 
21
 
22
  def search_drug_web_simple(drug_name: str) -> str:
 
63
 
64
 
65
  def _load_vl_model():
66
+ """단일 VL λͺ¨λΈ λ‘œλ“œ - ZeroGPU μ΅œμ ν™”"""
67
  device_map = "auto" if torch.cuda.is_available() else None
68
+ dtype = torch.float16 if torch.cuda.is_available() else torch.float32
69
 
70
  model = AutoModelForVision2Seq.from_pretrained(
71
  VL_MODEL_ID,
 
80
  return model, processor
81
 
82
 
83
+ print("πŸ”„ Loading Qwen2.5-VL-7B model...")
84
  VL_MODEL, VL_PROCESSOR = _load_vl_model()
85
  print("βœ… Model loaded successfully!")
86
 
 
675
  <h1>πŸ₯ MedCard Pro</h1>
676
  <p>
677
  <strong>AI 기반 슀마트 μ•½λ¬Ό 관리 μ‹œμŠ€ν…œ</strong><br>
678
+ Qwen2.5-VL이 μ•½λ΄‰νˆ¬λ₯Ό μ •ν™•νžˆ λΆ„μ„ν•˜κ³ , μ›Ήμ—μ„œ μ‹€μ‹œκ°„μœΌλ‘œ 정보λ₯Ό κ²€μ¦ν•˜μ—¬<br>
679
  μ–΄λ₯΄μ‹ κ³Ό 어린이 λͺ¨λ‘κ°€ 이해할 수 μžˆλŠ” λ§žμΆ€ν˜• 볡약 μ•ˆλ‚΄λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.
680
  </p>
681
  </div>