Token Classification
Transformers
ONNX
Safetensors
English
Japanese
Chinese
bert
anime
filename-parsing
Eval Results (legacy)
Instructions to use ModerRAS/AniFileBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ModerRAS/AniFileBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="ModerRAS/AniFileBERT")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("ModerRAS/AniFileBERT") model = AutoModelForTokenClassification.from_pretrained("ModerRAS/AniFileBERT") - Notebooks
- Google Colab
- Kaggle
修复colab_train.py shell引号嵌套导致的Syntax error
Browse files- colab_train.py +3 -2
colab_train.py
CHANGED
|
@@ -83,13 +83,14 @@ print("\n" + "=" * 60)
|
|
| 83 |
print("STEP 4: Verify GPU")
|
| 84 |
print("=" * 60)
|
| 85 |
run("nvidia-smi 2>/dev/null || echo 'No GPU found — training will be slow on CPU'")
|
| 86 |
-
|
|
|
|
| 87 |
|
| 88 |
# ── 5. Verify vocab ────────────────────────────────────────────
|
| 89 |
print("\n" + "=" * 60)
|
| 90 |
print("STEP 5: Verify vocabulary")
|
| 91 |
print("=" * 60)
|
| 92 |
-
run(
|
| 93 |
|
| 94 |
# ── 6. Run training ────────────────────────────────────────────
|
| 95 |
print("\n" + "=" * 60)
|
|
|
|
| 83 |
print("STEP 4: Verify GPU")
|
| 84 |
print("=" * 60)
|
| 85 |
run("nvidia-smi 2>/dev/null || echo 'No GPU found — training will be slow on CPU'")
|
| 86 |
+
# Single-quote the shell command to avoid bash expanding {torch...}
|
| 87 |
+
run("python -c 'import torch; print(f\"PyTorch {torch.__version__}, CUDA available: {torch.cuda.is_available()}\")'")
|
| 88 |
|
| 89 |
# ── 5. Verify vocab ────────────────────────────────────────────
|
| 90 |
print("\n" + "=" * 60)
|
| 91 |
print("STEP 5: Verify vocabulary")
|
| 92 |
print("=" * 60)
|
| 93 |
+
run("python -c 'import json; v=json.load(open(\"vocab.json\")); print(f\"Vocab size: {len(v)} tokens\")'")
|
| 94 |
|
| 95 |
# ── 6. Run training ────────────────────────────────────────────
|
| 96 |
print("\n" + "=" * 60)
|