Yuchan
commited on
Update Inference.py
Browse files- Inference.py +4 -4
Inference.py
CHANGED
|
@@ -46,13 +46,13 @@ def download_file(url, save_path):
|
|
| 46 |
f.write(chunk)
|
| 47 |
print(f"✅ {save_path} 저장됨")
|
| 48 |
|
| 49 |
-
|
| 50 |
TOKENIZER_PATH = "ko_unigram.model"
|
| 51 |
|
| 52 |
if not os.path.exists(DATA_PATH):
|
| 53 |
download_file(
|
| 54 |
-
"https://huggingface.co/
|
| 55 |
-
|
| 56 |
)
|
| 57 |
|
| 58 |
if not os.path.exists(TOKENIZER_PATH):
|
|
@@ -189,7 +189,7 @@ model = ReLM(
|
|
| 189 |
dummy_input = np.zeros((1, max_len), dtype=np.int32)
|
| 190 |
_ = model(dummy_input)
|
| 191 |
model.summary()
|
| 192 |
-
model.load_weights(
|
| 193 |
print("모델 가중치 로드 완료!")
|
| 194 |
# =======================
|
| 195 |
# 6) 추론 함수 (기존 코드 유지)
|
|
|
|
| 46 |
f.write(chunk)
|
| 47 |
print(f"✅ {save_path} 저장됨")
|
| 48 |
|
| 49 |
+
MODEL_PATH = "model.weight.h5"
|
| 50 |
TOKENIZER_PATH = "ko_unigram.model"
|
| 51 |
|
| 52 |
if not os.path.exists(DATA_PATH):
|
| 53 |
download_file(
|
| 54 |
+
"https://huggingface.co/Yuchan5386/Model_Prototype/resolve/main/model.weights.h5?download=true",
|
| 55 |
+
MODEL_PATH
|
| 56 |
)
|
| 57 |
|
| 58 |
if not os.path.exists(TOKENIZER_PATH):
|
|
|
|
| 189 |
dummy_input = np.zeros((1, max_len), dtype=np.int32)
|
| 190 |
_ = model(dummy_input)
|
| 191 |
model.summary()
|
| 192 |
+
model.load_weights(MODEL_PATH)
|
| 193 |
print("모델 가중치 로드 완료!")
|
| 194 |
# =======================
|
| 195 |
# 6) 추론 함수 (기존 코드 유지)
|