Text Classification
Laya
Safetensors
English
banking77
intent-classification
calibrated
selective-prediction
Eval Results (legacy)
Instructions to use VibeHash/laya-banking77 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use VibeHash/laya-banking77 with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 3,291 Bytes
4e09985 | 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | """The release step must not publish a local path, and must not mistake a Hub ID for one."""
from __future__ import annotations
import json
import tempfile
import unittest
from pathlib import Path
from banking77 import package
class LooksLocalTests(unittest.TestCase):
def test_absolute_paths_are_local(self):
for value in ("C:\\Users\\someone\\data.jsonl", "c:/data/x.jsonl", "/home/someone/x", "~/x", "\\\\srv\\share"):
self.assertTrue(package.looks_local(value), value)
def test_hub_ids_and_words_are_not(self):
for value in ("convaiinnovations/laya", "rlcd", "choice:11+", "2026-11-13"):
self.assertFalse(package.looks_local(value), value)
class RepoIdTests(unittest.TestCase):
def test_accepts_owner_and_name(self):
self.assertEqual(package.check_repo_id("some-one/laya-banking77"), "some-one/laya-banking77")
def test_refuses_the_placeholder_and_malformed_ids(self):
for value in (package.PLACEHOLDER, "laya-banking77", "a/b/c", "a b/c", "/laya-banking77"):
with self.assertRaises(ValueError, msg=value):
package.check_repo_id(value)
class FillTests(unittest.TestCase):
def test_replaces_every_placeholder(self):
with tempfile.TemporaryDirectory() as tmp:
path = Path(tmp) / "README.md"
path.write_text("load %s, then %s" % (package.PLACEHOLDER, package.PLACEHOLDER), encoding="utf-8")
package.fill_repo(path, "someone/laya-banking77")
self.assertEqual(path.read_text(encoding="utf-8"),
"load someone/laya-banking77, then someone/laya-banking77")
class ScrubTests(unittest.TestCase):
def test_drops_local_paths_from_the_training_block_only(self):
cfg = {"encoder": "answerdotai/ModernBERT-large",
"training": {"data": "C:\\Users\\someone\\train.jsonl", "epochs_completed": 4,
"base": "convaiinnovations/laya"}}
with tempfile.TemporaryDirectory() as tmp:
path = Path(tmp) / "rl_agent_config.json"
path.write_text(json.dumps(cfg), encoding="utf-8")
package.scrub_config(path)
out = json.loads(path.read_text(encoding="utf-8"))
self.assertEqual(out["training"], {"epochs_completed": 4, "base": "convaiinnovations/laya"})
self.assertEqual(out["encoder"], "answerdotai/ModernBERT-large")
class LeakTests(unittest.TestCase):
def test_finds_a_home_folder_written_with_either_slash(self):
with tempfile.TemporaryDirectory() as tmp:
folder = Path(tmp)
(folder / "a.json").write_text('{"p": "C:\\\\Users\\\\someone\\\\x"}', encoding="utf-8")
(folder / "b.md").write_text("nothing here", encoding="utf-8")
self.assertEqual(package.local_path_leaks(folder, ["C:\\Users\\someone"]), ["a.json"])
self.assertEqual(package.local_path_leaks(folder, ["c:/users/someone"]), ["a.json"])
def test_clean_folder_passes(self):
with tempfile.TemporaryDirectory() as tmp:
(Path(tmp) / "c.json").write_text('{"ok": true}', encoding="utf-8")
self.assertEqual(package.local_path_leaks(Path(tmp), ["C:\\Users\\someone"]), [])
if __name__ == "__main__":
unittest.main()
|