Fill-Mask
Transformers
Safetensors
Korean
Literary Chinese
bert
text-generation
sillok
history
korean-history
classical-chinese
Instructions to use ddokbaro/SillokBert-Scratch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ddokbaro/SillokBert-Scratch with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="ddokbaro/SillokBert-Scratch")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("ddokbaro/SillokBert-Scratch") model = AutoModelForMaskedLM.from_pretrained("ddokbaro/SillokBert-Scratch", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,845 Bytes
170de4d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # SillokBert-Scratch ํ๋ก์ ํธ 6๋จ๊ณ: TensorBoard ๋ก๊ทธ ์ถ์ถ
# -----------------------------------------------------------------
# 'logs' ํด๋์ ํ๋ จ ๊ธฐ๋ก์ ํ
์คํธ๋ก ํ์ธํ๊ธฐ ์ํด ์ฌ์ฉํฉ๋๋ค.
# -----------------------------------------------------------------
import os
from pathlib import Path
from tensorboard.backend.event_processing import event_accumulator
def export_tensorboard_logs_to_text(log_dir: str):
"""์ง์ ๋ ๋๋ ํ ๋ฆฌ์์ TensorBoard ์ด๋ฒคํธ ํ์ผ์ ์ฐพ์ ์ค์นผ๋ผ ๊ฐ์ ์ถ๋ ฅํฉ๋๋ค."""
log_path = Path(log_dir)
if not log_path.exists() or not log_path.is_dir():
print(f"[์๋ฌ] ๋ก๊ทธ ๋๋ ํ ๋ฆฌ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค: {log_dir}")
return
print(f"--- 6. TensorBoard Log Export ---")
print(f"๋์ ๋๋ ํ ๋ฆฌ: {log_dir}")
try:
event_file = next(log_path.glob("events.out.tfevents.*"))
except StopIteration:
print(f"[์๋ฌ] '{log_dir}'์์ ์ด๋ฒคํธ ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค.")
return
acc = event_accumulator.EventAccumulator(str(event_file), size_guidance={'scalars': 0})
acc.Reload()
scalar_tags = acc.Tags()['scalars']
print(f"\n์ถ์ถ๋ ์งํ: {scalar_tags}")
print("-" * 40)
for tag in sorted(scalar_tags):
events = acc.Scalars(tag)
print(f"\n[์งํ: {tag}]")
print(" Step | Value")
print("-------|---------")
for event in events:
print(f" {event.step:<5} | {event.value:.6f}")
print("\n--- ๋ถ์ ์๋ฃ ---")
if __name__ == "__main__":
# ํ๊น
ํ์ด์ค ๋ฆฌํฌ์งํ ๋ฆฌ์ 'logs' ํด๋๋ฅผ ์ฐธ์กฐํ๋๋ก ์๋ ๊ฒฝ๋ก๋ก ์ค์
target_log_directory = "./logs"
export_tensorboard_logs_to_text(target_log_directory)
|