gbrabbit commited on
Commit
03c1f0f
ยท
1 Parent(s): 86725e1

Auto commit at 09-2025-08 1:35:45

Browse files
Files changed (1) hide show
  1. lily_llm_api/app_v2.py +21 -1
lily_llm_api/app_v2.py CHANGED
@@ -233,7 +233,27 @@ def load_model_sync(model_id: str):
233
  logger.info("๐Ÿ”ง ํ† ํฌ๋‚˜์ด์ € ๋ฉ€ํ‹ฐ๋ชจ๋‹ฌ ๊ธฐ๋Šฅ ํ™œ์„ฑํ™”...")
234
  tokenizer.mllm_setup(num_visual_tokens=1)
235
  from transformers import AutoImageProcessor
236
- image_processor = AutoImageProcessor.from_pretrained(current_profile.local_path, trust_remote_code=True, local_files_only=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  logger.info("โœ… ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ ๋กœ๋“œ ์„ฑ๊ณต!")
238
  else:
239
  image_processor = None
 
233
  logger.info("๐Ÿ”ง ํ† ํฌ๋‚˜์ด์ € ๋ฉ€ํ‹ฐ๋ชจ๋‹ฌ ๊ธฐ๋Šฅ ํ™œ์„ฑํ™”...")
234
  tokenizer.mllm_setup(num_visual_tokens=1)
235
  from transformers import AutoImageProcessor
236
+
237
+ # ํ™˜๊ฒฝ์— ๋”ฐ๋ผ ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ ๋กœ๋”ฉ ๋ถ„๊ธฐ
238
+ if current_profile.is_local:
239
+ # ๋กœ์ปฌ ํ™˜๊ฒฝ: ๋กœ์ปฌ ๊ฒฝ๋กœ ์‚ฌ์šฉ
240
+ logger.info("๐Ÿ  ๋กœ์ปฌ ํ™˜๊ฒฝ์—์„œ ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ ๋กœ๋”ฉ")
241
+ image_processor = AutoImageProcessor.from_pretrained(
242
+ current_profile.local_path,
243
+ trust_remote_code=True,
244
+ local_files_only=True,
245
+ )
246
+ else:
247
+ # ์„œ๋ฒ„ ํ™˜๊ฒฝ: ๋ชจ๋ธ๋ช… ์‚ฌ์šฉ, HF ํ† ํฐ ํ•„์š”
248
+ logger.info("โ˜๏ธ ์„œ๋ฒ„ ํ™˜๊ฒฝ์—์„œ ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ ๋กœ๋”ฉ")
249
+ import os
250
+ HF_TOKEN = os.getenv("HF_TOKEN")
251
+ image_processor = AutoImageProcessor.from_pretrained(
252
+ current_profile.model_name, # local_path ๋Œ€์‹  model_name ์‚ฌ์šฉ
253
+ token=HF_TOKEN,
254
+ trust_remote_code=True,
255
+ local_files_only=False, # ์„œ๋ฒ„์—์„œ๋Š” False
256
+ )
257
  logger.info("โœ… ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ ๋กœ๋“œ ์„ฑ๊ณต!")
258
  else:
259
  image_processor = None