Instructions to use botezx/flagtldr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Grok
How to use botezx/flagtldr with Grok:
# 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 classifier/src/xaddons_classifier/cli.py from botezx/flagtldr: direct link, hf CLI and curl.
- Browser
- Download file 979 Bytes
-
https://huggingface.co/botezx/flagtldr/resolve/main/classifier/src/xaddons_classifier/cli.py
- Command line
-
hf download hf://botezx/flagtldr/classifier/src/xaddons_classifier/cli.py
-
curl -L -o cli.py https://huggingface.co/botezx/flagtldr/resolve/main/classifier/src/xaddons_classifier/cli.py
979 Bytes
| from __future__ import annotations | |
| import argparse | |
| def main() -> None: | |
| ap = argparse.ArgumentParser(prog="xaddons-classifier") | |
| sub = ap.add_subparsers(dest="cmd", required=True) | |
| s = sub.add_parser("serve", help="run the local HTTP service for the extension") | |
| s.add_argument("--backend", choices=["rules", "basal", "embed"], default="rules") | |
| s.add_argument("--basal-url", default="http://127.0.0.1:8000") | |
| s.add_argument("--embed-model", default=None) | |
| s.add_argument("--host", default="127.0.0.1") | |
| s.add_argument("--port", type=int, default=8765) | |
| a = ap.parse_args() | |
| import uvicorn | |
| from .backends import get_backend | |
| from .server import create_app | |
| kw = {} | |
| if a.backend == "basal": | |
| kw["url"] = a.basal_url | |
| if a.backend == "embed" and a.embed_model: | |
| kw["model"] = a.embed_model | |
| uvicorn.run(create_app(get_backend(a.backend, **kw)), host=a.host, port=a.port) | |
| if __name__ == "__main__": | |
| main() | |