Merge commit '397efb86dc84197b74d9a3b16a11b1d0d534ad9e' as 'integrations/document-ai'
This commit is contained in:
88
integrations/document-ai/check_installation.py
Normal file
88
integrations/document-ai/check_installation.py
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
환경 설정 확인 스크립트
|
||||
"""
|
||||
|
||||
def check_installation():
|
||||
print("🔍 설치된 패키지 확인 중...")
|
||||
|
||||
try:
|
||||
import torch
|
||||
print(f"✅ PyTorch: {torch.__version__}")
|
||||
|
||||
# Apple Silicon MPS 확인
|
||||
if torch.backends.mps.is_available():
|
||||
print("✅ Apple Silicon MPS 가속 사용 가능")
|
||||
else:
|
||||
print("⚠️ MPS 가속 사용 불가 (CPU 모드)")
|
||||
|
||||
except ImportError:
|
||||
print("❌ PyTorch 설치 실패")
|
||||
return False
|
||||
|
||||
try:
|
||||
import transformers
|
||||
print(f"✅ Transformers: {transformers.__version__}")
|
||||
except ImportError:
|
||||
print("❌ Transformers 설치 실패")
|
||||
return False
|
||||
|
||||
try:
|
||||
import sentencepiece
|
||||
print("✅ SentencePiece 설치 완료")
|
||||
except ImportError:
|
||||
print("❌ SentencePiece 설치 실패")
|
||||
return False
|
||||
|
||||
try:
|
||||
import accelerate
|
||||
print("✅ Accelerate 설치 완료")
|
||||
except ImportError:
|
||||
print("❌ Accelerate 설치 실패")
|
||||
return False
|
||||
|
||||
# 문서 처리 라이브러리 확인
|
||||
doc_libs = []
|
||||
try:
|
||||
import PyPDF2
|
||||
doc_libs.append("PyPDF2")
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import pdfplumber
|
||||
doc_libs.append("pdfplumber")
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from docx import Document
|
||||
doc_libs.append("python-docx")
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if doc_libs:
|
||||
print(f"✅ 문서 처리: {', '.join(doc_libs)}")
|
||||
else:
|
||||
print("⚠️ 문서 처리 라이브러리 설치 필요")
|
||||
|
||||
# 시스템 정보
|
||||
print(f"\n📊 시스템 정보:")
|
||||
print(f" Python 버전: {torch.version.python}")
|
||||
if torch.backends.mps.is_available():
|
||||
print(f" 디바이스: Apple Silicon (MPS)")
|
||||
else:
|
||||
print(f" 디바이스: CPU")
|
||||
|
||||
return True
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("🚀 NLLB 번역 시스템 환경 확인")
|
||||
print("=" * 40)
|
||||
|
||||
if check_installation():
|
||||
print("\n🎉 환경 설정 완료!")
|
||||
print("다음 단계: NLLB 모델 다운로드")
|
||||
else:
|
||||
print("\n❌ 환경 설정 실패")
|
||||
print("패키지 재설치 필요")
|
||||
Reference in New Issue
Block a user