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
Download code/tests/test_package.py from VibeHash/laya-banking77: direct link, hf CLI and curl.
- Browser
- Download file 3.29 kB
-
https://huggingface.co/VibeHash/laya-banking77/resolve/main/code/tests/test_package.py
- Command line
-
hf download hf://VibeHash/laya-banking77/code/tests/test_package.py
-
curl -L -o test_package.py https://huggingface.co/VibeHash/laya-banking77/resolve/main/code/tests/test_package.py
3.29 kB
| """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() | |