feat: AI 웹 스크래퍼의 핵심 컴포넌트 및 실행 가이드 구현
This commit is contained in:
@@ -15,18 +15,27 @@ def main():
|
||||
|
||||
print("AI 웹 정보 수집 시스템 시작")
|
||||
|
||||
# 1. 모델 다운로드 (필요한 경우)
|
||||
# 1. 설정 파일 로드
|
||||
with open(args.config, 'r') as f:
|
||||
config = json.load(f)
|
||||
|
||||
# 2. 모델 다운로드 (필요한 경우)
|
||||
print("모델 확인 중...")
|
||||
model, tokenizer = download_model(args.config)
|
||||
|
||||
if model is None:
|
||||
# 모델 로딩은 AIAgent에서 수행하므로, 다운로드만 성공해도 계속 진행
|
||||
# 로컬 경로에 스냅샷 파일 유무로 성공 여부 확인
|
||||
local_model_path = config.get('model_local_path', './models/model')
|
||||
has_files = False
|
||||
try:
|
||||
has_files = any(True for _ in __import__('os').scandir(local_model_path))
|
||||
except Exception:
|
||||
has_files = False
|
||||
|
||||
if (model is None and not has_files):
|
||||
print("모델 다운로드 실패. 프로그램을 종료합니다.")
|
||||
sys.exit(1)
|
||||
|
||||
# 2. 설정 파일 로드 및 수정
|
||||
with open(args.config, 'r') as f:
|
||||
config = json.load(f)
|
||||
|
||||
if args.save_path:
|
||||
config['data_storage']['drive_mount_path'] = args.save_path
|
||||
# 수정된 config 저장
|
||||
|
||||
Reference in New Issue
Block a user