SOY NV AI commited on
Commit
eb70b46
·
1 Parent(s): 5c2af3e

보안: Hugging Face 토큰을 환경 변수로 변경

Browse files
EXAONE_추가_안내.md CHANGED
@@ -49,7 +49,7 @@ Ollama를 거치지 않고 Python에서 직접 Hugging Face 모델을 사용할
49
 
50
  ## 현재 설정된 정보
51
 
52
- - **Hugging Face 토큰**: `YOUR_HUGGINGFACE_TOKEN_HERE`
53
  - **모델 이름**: `LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct`
54
  - **생성된 Modelfile**: `EXAONE-3.0-7.8B-Instruct.modelfile`
55
 
 
49
 
50
  ## 현재 설정된 정보
51
 
52
+ - **Hugging Face 토큰**: 환경 변수에서 설정 필요 (`HUGGINGFACE_HUB_TOKEN`)
53
  - **모델 이름**: `LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct`
54
  - **생성된 Modelfile**: `EXAONE-3.0-7.8B-Instruct.modelfile`
55
 
add_exaone_with_token.py CHANGED
@@ -6,8 +6,10 @@ import os
6
  import subprocess
7
  from pathlib import Path
8
 
9
- # Hugging Face 토큰
10
- HF_TOKEN = "YOUR_HUGGINGFACE_TOKEN_HERE"
 
 
11
 
12
  def set_huggingface_token():
13
  """Hugging Face 토큰 설정"""
@@ -169,7 +171,7 @@ if __name__ == "__main__":
169
  print("=" * 60)
170
  print("\n수동으로 모델을 생성하려면:")
171
  print(f" 1. Hugging Face 토큰 설정:")
172
- print(f" $env:HUGGINGFACE_HUB_TOKEN='{HF_TOKEN}'")
173
  print(f" 2. Modelfile로 모델 생성:")
174
  print(f" ollama create EXAONE-3.0-7.8B-Instruct -f {modelfile_path}")
175
  print("=" * 60)
 
6
  import subprocess
7
  from pathlib import Path
8
 
9
+ # Hugging Face 토큰 (환경 변수에서 읽기)
10
+ HF_TOKEN = os.environ.get("HUGGINGFACE_HUB_TOKEN") or os.environ.get("HF_TOKEN")
11
+ if not HF_TOKEN:
12
+ raise ValueError("HUGGINGFACE_HUB_TOKEN 또는 HF_TOKEN 환경 변수를 설정해주세요.")
13
 
14
  def set_huggingface_token():
15
  """Hugging Face 토큰 설정"""
 
171
  print("=" * 60)
172
  print("\n수동으로 모델을 생성하려면:")
173
  print(f" 1. Hugging Face 토큰 설정:")
174
+ print(f" $env:HUGGINGFACE_HUB_TOKEN='YOUR_TOKEN_HERE'")
175
  print(f" 2. Modelfile로 모델 생성:")
176
  print(f" ollama create EXAONE-3.0-7.8B-Instruct -f {modelfile_path}")
177
  print("=" * 60)
download_exaone_model.py CHANGED
@@ -6,7 +6,10 @@ Ollama에서 사용할 수 있도록 준비하는 스크립트
6
  import os
7
  from huggingface_hub import snapshot_download, login
8
 
9
- HF_TOKEN = "YOUR_HUGGINGFACE_TOKEN_HERE"
 
 
 
10
  MODEL_NAME = "LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct"
11
 
12
  def download_model():
 
6
  import os
7
  from huggingface_hub import snapshot_download, login
8
 
9
+ # Hugging Face 토큰 (환경 변수에서 읽기)
10
+ HF_TOKEN = os.environ.get("HUGGINGFACE_HUB_TOKEN") or os.environ.get("HF_TOKEN")
11
+ if not HF_TOKEN:
12
+ raise ValueError("HUGGINGFACE_HUB_TOKEN 또는 HF_TOKEN 환경 변수를 설정해주세요.")
13
  MODEL_NAME = "LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct"
14
 
15
  def download_model():
install_exaone_direct.py CHANGED
@@ -7,7 +7,10 @@ import os
7
  import subprocess
8
  import json
9
 
10
- HF_TOKEN = "YOUR_HUGGINGFACE_TOKEN_HERE"
 
 
 
11
 
12
  def create_simple_modelfile():
13
  """간단한 Modelfile 생성 (로컬 경로 대신 모델 이름만 사용)"""
 
7
  import subprocess
8
  import json
9
 
10
+ # Hugging Face 토큰 (환경 변수에서 읽기)
11
+ HF_TOKEN = os.environ.get("HUGGINGFACE_HUB_TOKEN") or os.environ.get("HF_TOKEN")
12
+ if not HF_TOKEN:
13
+ raise ValueError("HUGGINGFACE_HUB_TOKEN 또는 HF_TOKEN 환경 변수를 설정해주세요.")
14
 
15
  def create_simple_modelfile():
16
  """간단한 Modelfile 생성 (로컬 경로 대신 모델 이름만 사용)"""
install_exaone_simple.py CHANGED
@@ -8,7 +8,10 @@ import os
8
  import subprocess
9
  from pathlib import Path
10
 
11
- HF_TOKEN = "YOUR_HUGGINGFACE_TOKEN_HERE"
 
 
 
12
 
13
  def main():
14
  print("\n" + "=" * 60)
 
8
  import subprocess
9
  from pathlib import Path
10
 
11
+ # Hugging Face 토큰 (환경 변수에서 읽기)
12
+ HF_TOKEN = os.environ.get("HUGGINGFACE_HUB_TOKEN") or os.environ.get("HF_TOKEN")
13
+ if not HF_TOKEN:
14
+ raise ValueError("HUGGINGFACE_HUB_TOKEN 또는 HF_TOKEN 환경 변수를 설정해주세요.")
15
 
16
  def main():
17
  print("\n" + "=" * 60)