Image Classification
Transformers
Safetensors
qwen3_5
feature-extraction
clef
bitsandbytes
quantized
4-bit precision
Instructions to use Aikimi/clef-nf4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aikimi/clef-nf4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="Aikimi/clef-nf4") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("Aikimi/clef-nf4") model = AutoModel.from_pretrained("Aikimi/clef-nf4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download inference.py from Aikimi/clef-nf4: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/Aikimi/clef-nf4/resolve/main/inference.py
- Command line
-
hf download hf://Aikimi/clef-nf4/inference.py
-
curl -L -o inference.py https://huggingface.co/Aikimi/clef-nf4/resolve/main/inference.py
1.52 kB
| """Run a downloaded Clef quantized bundle, without Forge or source checkpoints.""" | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--profile", choices=["flash-int8", "clef-24gb", "clef-16gb"], required=True) | |
| parser.add_argument("--image", type=Path) | |
| parser.add_argument("--questions", type=Path) | |
| parser.add_argument("--state", default="添付画像を評価してください。") | |
| parser.add_argument("--max-pixels", type=int, default=262144) | |
| parser.add_argument("--max-length", type=int, default=2048) | |
| args = parser.parse_args() | |
| from clef_runtime.core import TEMPLATES, validate_request | |
| from clef_runtime.runtime import Runner | |
| questions = json.loads(args.questions.read_text(encoding="utf-8")) if args.questions else TEMPLATES["画像の評価"] | |
| request = validate_request( | |
| { | |
| "profile": args.profile, | |
| "questions": questions, | |
| "state": args.state, | |
| "max_pixels": args.max_pixels, | |
| "max_length": args.max_length, | |
| } | |
| ) | |
| runner = Runner.from_directory(Path(__file__).resolve().parent, args.profile) | |
| try: | |
| result = runner.decide(request, str(args.image.resolve()) if args.image else None) | |
| print(json.dumps(result, ensure_ascii=False, indent=2), flush=True) # noqa: T201 | |
| finally: | |
| runner.close() | |
| if __name__ == "__main__": | |
| main() | |