Instructions to use litert-community/GLiClass-Edge-v3.0-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/GLiClass-Edge-v3.0-LiteRT with LiteRT:
# 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
GLiClass-Edge v3.0 for LiteRT: S128 and S256 graphs (fp32 and fp16 weights), float16 token table, tokenizer, Python host, Android sample, conversion scripts, fixtures and card
88c9095 verified Download examples/run_example.py from litert-community/GLiClass-Edge-v3.0-LiteRT: direct link, hf CLI and curl.
- Browser
- Download file 941 Bytes
-
https://huggingface.co/litert-community/GLiClass-Edge-v3.0-LiteRT/resolve/main/examples/run_example.py
- Command line
-
hf download hf://litert-community/GLiClass-Edge-v3.0-LiteRT/examples/run_example.py
-
curl -L -o run_example.py https://huggingface.co/litert-community/GLiClass-Edge-v3.0-LiteRT/resolve/main/examples/run_example.py
941 Bytes
| """The model card's Python example: one invented support ticket, single-label and multi-label. | |
| Run from the repository root: python examples/run_example.py | |
| """ | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| from gliclass_litert import GliclassLiteRT # noqa: E402 | |
| text = ( | |
| "The Zorvik X2 router from Tallowmere Networks keeps dropping the connection every evening " | |
| "around 9 pm. I have restarted it and reset it to factory settings, but the status light " | |
| "still blinks orange." | |
| ) | |
| labels = ["connectivity problem", "hardware defect", "billing issue", "feature request", | |
| "installation help"] | |
| with GliclassLiteRT(Path(__file__).resolve().parents[1]) as classifier: | |
| for mode in ("single-label", "multi-label"): | |
| result = classifier.classify(text, labels, classification_type=mode) | |
| print(mode, [(r["label"], round(r["score"], 3)) for r in result]) | |