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
Download scripts/6_export_logs.py from ddokbaro/SillokBert-Scratch: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/ddokbaro/SillokBert-Scratch/resolve/main/scripts/6_export_logs.py
- Command line
-
hf download hf://ddokbaro/SillokBert-Scratch/scripts/6_export_logs.py
-
curl -L -o 6_export_logs.py https://huggingface.co/ddokbaro/SillokBert-Scratch/resolve/main/scripts/6_export_logs.py
1.85 kB
| # 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) | |