제미나이 gpt로 변경
parent
236c7916a7
commit
7ec9e9749d
|
|
@ -304,13 +304,14 @@ async def _crawling_logic(
|
||||||
extra_photo_urls = scraper.extra_photo_urls or []
|
extra_photo_urls = scraper.extra_photo_urls or []
|
||||||
|
|
||||||
if len(owner_images) >= NvMapScraper.SUPPLEMENT_THRESHOLD:
|
if len(owner_images) >= NvMapScraper.SUPPLEMENT_THRESHOLD:
|
||||||
# 업체 제공 사진은 필터링 면제 대상이므로 상한 없이 전량 사용한다
|
# 업체 제공 사진은 필터링 면제 대상이므로 MAX_IMAGES 상한 없이 수집분을 전부 사용한다
|
||||||
# (MAX_IMAGES 상한은 방문자 사진이 섞이는 보충 경로에만 적용).
|
# (MAX_IMAGES 상한은 방문자 사진이 섞이는 보충 경로에만 적용.
|
||||||
|
# 수집 자체는 NvMapScraper.BIZ_MAX_PAGES가 상한이며 도달 시 scraper가 warning을 남긴다).
|
||||||
scraper.image_link_list = list(owner_images)
|
scraper.image_link_list = list(owner_images)
|
||||||
step3_elapsed = (time.perf_counter() - step3_start) * 1000
|
step3_elapsed = (time.perf_counter() - step3_start) * 1000
|
||||||
logger.info(
|
logger.info(
|
||||||
f"[crawling] Step 3 SKIP - 업체 사진 {len(owner_images)}장 "
|
f"[crawling] Step 3 SKIP - 업체 사진 {len(owner_images)}장 "
|
||||||
f"≥ {NvMapScraper.SUPPLEMENT_THRESHOLD}장 → 방문자 사진 필터링 생략, 전량 사용"
|
f"≥ {NvMapScraper.SUPPLEMENT_THRESHOLD}장 → 방문자 사진 필터링 생략, 업체 사진만 사용"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from app.utils.prompts.schemas import SpaceType, Subject, Camera, MotionRecommen
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
async def autotag_image(image_url : str, industry: str = "") -> list[str]: #tag_list
|
async def autotag_image(image_url : str, industry: str = "") -> list[str]: #tag_list
|
||||||
chatgpt = ChatgptService(model_type="gemini")
|
chatgpt = ChatgptService(model_type="gpt")
|
||||||
image_input_data = {
|
image_input_data = {
|
||||||
"img_url" : image_url,
|
"img_url" : image_url,
|
||||||
"industry" : industry,
|
"industry" : industry,
|
||||||
|
|
@ -21,7 +21,7 @@ async def autotag_image(image_url : str, industry: str = "") -> list[str]: #tag_
|
||||||
return image_result
|
return image_result
|
||||||
|
|
||||||
async def autotag_images(image_url_list : list[str], industry: str = "") -> list[dict]: #tag_list
|
async def autotag_images(image_url_list : list[str], industry: str = "") -> list[dict]: #tag_list
|
||||||
chatgpt = ChatgptService(model_type="gemini")
|
chatgpt = ChatgptService(model_type="gpt")
|
||||||
image_input_data_list = [{
|
image_input_data_list = [{
|
||||||
"img_url" : image_url,
|
"img_url" : image_url,
|
||||||
"industry" : industry,
|
"industry" : industry,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ from app.utils.prompts.schemas import MarketingFilterOutput
|
||||||
logger = get_logger("image_filter")
|
logger = get_logger("image_filter")
|
||||||
|
|
||||||
# 크롤링 단계 필터링에 사용할 Gemini 모델. 시트(prompts.py)와 달리 코드에 고정한다.
|
# 크롤링 단계 필터링에 사용할 Gemini 모델. 시트(prompts.py)와 달리 코드에 고정한다.
|
||||||
MARKETING_FILTER_MODEL = "gemini-3.5-flash"
|
MARKETING_FILTER_MODEL = "gpt-5-mini"
|
||||||
|
|
||||||
MAX_RETRY = 2
|
MAX_RETRY = 2
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ async def filter_marketing_images(image_url_list: list[str], industry: str = "")
|
||||||
if not image_url_list:
|
if not image_url_list:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
chatgpt = ChatgptService(model_type="gemini")
|
chatgpt = ChatgptService(model_type="gpt")
|
||||||
prompt_text = _build_prompt(industry)
|
prompt_text = _build_prompt(industry)
|
||||||
|
|
||||||
async def _call(url: str):
|
async def _call(url: str):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue