""" EXAONE-3.0-7.8B-Instruct를 Ollama에 직접 추가하는 스크립트 토큰을 사용하여 모델을 추가합니다. """ import os import subprocess import json HF_TOKEN = "YOUR_HUGGINGFACE_TOKEN_HERE" def create_simple_modelfile(): """간단한 Modelfile 생성 (로컬 경로 대신 모델 이름만 사용)""" modelfile_content = """# EXAONE-3.0-7.8B-Instruct 모델 설정 # 참고: Ollama가 Hugging Face 모델을 직접 지원하지 않는 경우 # 다른 방법이 필요할 수 있습니다. PARAMETER temperature 0.7 PARAMETER top_p 0.9 PARAMETER top_k 40 PARAMETER num_ctx 4096 SYSTEM \"\"\"You are EXAONE, a helpful AI assistant developed by LG AI Research. You can communicate in both Korean and English.\"\"\" """ with open("EXAONE-3.0-7.8B-Instruct.modelfile", "w", encoding="utf-8") as f: f.write(modelfile_content) print("[OK] Modelfile 생성 완료") def check_model_availability(): """모델이 이미 설치되어 있는지 확인""" try: result = subprocess.run(['ollama', 'list'], capture_output=True, text=True, timeout=5) if 'EXAONE' in result.stdout or 'exaone' in result.stdout.lower(): print("[INFO] EXAONE 모델이 이미 설치되어 있습니다.") return True return False except Exception as e: print(f"[WARNING] 모델 확인 중 오류: {e}") return False def main(): print("\n" + "=" * 60) print("EXAONE-3.0-7.8B-Instruct Ollama 추가 시도") print("=" * 60) # 토큰 설정 os.environ['HUGGINGFACE_HUB_TOKEN'] = HF_TOKEN print(f"[OK] Hugging Face 토큰 설정 완료") # 모델 확인 if check_model_availability(): print("\n모델이 이미 설치되어 있습니다.") return print("\n현재 Ollama 버전에서는 Hugging Face 모델을 직접 가져올 수 없습니다.") print("\n다음 방법을 시도해보세요:") print("\n1. Ollama를 최신 버전으로 업데이트") print(" https://ollama.ai/download") print("\n2. 수동으로 모델 정보 확인") print(" 현재 Ollama 버전 확인: ollama --version") print(" 사용 가능한 모델 확인: ollama list") print("\n3. EXAONE 모델의 GGUF 버전 찾기") print(" Hugging Face에서 GGUF 형식의 모델을 찾아보세요.") print("\n" + "=" * 60) print("참고: 현재 Ollama 0.13.0은 Hugging Face 모델 직접 지원이 제한적입니다.") print("=" * 60) if __name__ == "__main__": main()