Text-to-Image
Diffusers
Safetensors
GGUF
English
TeverationPipeline
teveration
image-to-image
depth-estimation
image-segmentation
ternary
quantized
jeveration
qwen3.5
bonsai
comfyui
custom_code
conversational
Run this model with HF Jobs
Run DmitrofNET/Teveration-1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/DmitrofNET/Teveration-1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/DmitrofNET/Teveration-1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use DmitrofNET/Teveration-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use DmitrofNET/Teveration-1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("DmitrofNET/Teveration-1", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use DmitrofNET/Teveration-1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf DmitrofNET/Teveration-1 # Run inference directly in the terminal: llama cli -hf DmitrofNET/Teveration-1
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf DmitrofNET/Teveration-1 # Run inference directly in the terminal: llama cli -hf DmitrofNET/Teveration-1
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf DmitrofNET/Teveration-1 # Run inference directly in the terminal: ./build/bin/llama cli -hf DmitrofNET/Teveration-1
Use Docker
docker model run hf.co/DmitrofNET/Teveration-1
- Llama new
- LM Studio
- Jan
- Draw Things
- DiffusionBee
- Ollama
How to use DmitrofNET/Teveration-1 with Ollama:
ollama run hf.co/DmitrofNET/Teveration-1
- Unsloth Desktop
- Pi
How to use DmitrofNET/Teveration-1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf DmitrofNET/Teveration-1
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "DmitrofNET/Teveration-1" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use DmitrofNET/Teveration-1 with Docker Model Runner:
docker model run hf.co/DmitrofNET/Teveration-1
- Lemonade
How to use DmitrofNET/Teveration-1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull DmitrofNET/Teveration-1
Run and chat with the model
lemonade run user.Teveration-1-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use DmitrofNET/Teveration-1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf DmitrofNET/Teveration-1
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default DmitrofNET/Teveration-1
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use DmitrofNET/Teveration-1 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf DmitrofNET/Teveration-1
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "DmitrofNET/Teveration-1" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Teveration 1: GGUF files, engine bindings, model card
Browse filesFiles changed (10)
- .gitattributes+4
- README.md+43-2
- STANDARD_BENCHMARKS.mdAdded+26
- images/standard_dpg.jpgAdded
- images/standard_geneval.jpgAdded
- images/standard_hps.jpgAdded
- images/standard_i2i.jpgAdded
- pipeline.py+32-10
- standard_metrics.jsonAdded+106
- teveration_engine.py+32-10
48 unmodified lines49505148 unmodified linesTeveration-1-balanced.gguf filter=lfs diff=lfs merge=lfs -textTeveration-1-high.gguf filter=lfs diff=lfs merge=lfs -textTeveration-1-small.gguf filter=lfs diff=lfs merge=lfs -text48 unmodified lines4950515253545548 unmodified linesTeveration-1-balanced.gguf filter=lfs diff=lfs merge=lfs -textTeveration-1-high.gguf filter=lfs diff=lfs merge=lfs -textTeveration-1-small.gguf filter=lfs diff=lfs merge=lfs -textimages/standard_dpg.jpg filter=lfs diff=lfs merge=lfs -textimages/standard_geneval.jpg filter=lfs diff=lfs merge=lfs -textimages/standard_hps.jpg filter=lfs diff=lfs merge=lfs -textimages/standard_i2i.jpg filter=lfs diff=lfs merge=lfs -text
159 unmodified lines160161162163164165166167159 unmodified lines## Standard benchmarks<!-- standard-benchmarks:begin -->GenEval, DPG-Bench, HPSv2.1, NYUv2 and image-to-image structure fidelity are being measured for Teveration and for theoriginal with `benchmarks/standard.py`. The results appear here when the run ends.<!-- standard-benchmarks:end -->## How it was made159 unmodified lines160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208159 unmodified lines## Standard benchmarks<!-- standard-benchmarks:begin -->Measured on one RTX 4070 with [`benchmarks/standard.py`](https://github.com/DmitrofNETDev/Teveration-1/blob/main/benchmarks/standard.py). Teveration and the originalanswer every request with the same random state and sampling draw and are scored by the same harness; the paper'sown numbers are shown as a check of the harness.**Text-to-image** (GenEval: 553 prompts, 4 pictures each; DPG-Bench: 1,065 prompts, 4 pictures each; HPSv2.1: 3,200 prompts)| | GenEval ↑ | DPG-Bench ↑ | HPSv2.1 ↑ ||---|---|---|---|| Jeveration, as published | 0.740 | 78.24 | 28.06 || Jeveration (original), this harness | 0.733 | 77.76 | 28.05 || Teveration 1 small | 0.706 | 77.08 | 27.68 || **Teveration 1 balanced** | 0.715 | 77.71 | 27.91 || Teveration 1 high | 0.721 | 77.85 | 27.97 |**Dense prediction**, the 654 NYUv2 test pictures against ground truth| | Segmentation mIoU ↑ | Depth abs. error (m) ↓ | Depth δ1 ↑ | Normals mean error (°) ↓ ||---|---|---|---|---|| Jeveration, as published | 67.7 | 0.267 | 0.898 | 24.2 || Jeveration (original), this harness | 67.6 | 0.267 | 0.898 | 24.2 || Teveration 1 small | 65.9 | 0.283 | 0.881 | 25.4 || **Teveration 1 balanced** | 66.8 | 0.278 | 0.888 | 25.0 || Teveration 1 high | 67.0 | 0.275 | 0.890 | 24.9 |**Image-to-image**, structure kept from the input, 341 COCO val2017 photos. The paper's own test set is not published, soits numbers (0.880, 0.802, 0.937) are from other pictures and are not comparable; compare the rows with each other.| | Edges to image, HED F1 ↑ | Depth to image, δ1 ↑ | Colorize, Canny F1 ↑ ||---|---|---|---|| Jeveration (original), this harness | 0.758 | 0.769 | 0.749 || Teveration 1 small | 0.743 | 0.751 | 0.741 || **Teveration 1 balanced** | 0.746 | 0.764 | 0.745 || Teveration 1 high | 0.750 | 0.755 | 0.746 |What differs from the papers' protocols: the GenEval detector is the Mask2Former Swin-S COCO checkpoint of its authors(run through transformers) instead of mmdet's retraining of the same network, and the image-to-image set is described above.Full protocol, per-task scores and request-by-request differences: [STANDARD.md](https://github.com/DmitrofNETDev/Teveration-1/blob/main/benchmarks/results/standard/STANDARD.md).Rows from the top: original, small, balanced, high. Columns are requests spread evenly over the benchmark, not chosen.<!-- standard-benchmarks:end -->## How it was made
1234567891011121314151617181920212223242526# Standard benchmarks
Run by `benchmarks/standard.py` on one RTX 4070. Higher is better except depth abs. and normals.
| | GenEval | HPSv2.1 | DPG-Bench | NYUv2 mIoU | depth abs. (m) | depth delta1 | normals mean (deg) | edges to image, HED F1 | depth to image, delta1 | colorize, Canny F1 |
|---|---|---|---|---|---|---|---|---|---|---|
| Jeveration, as published in its paper | 0.740 | 28.06 | 78.24 | 67.7 | 0.267 | 0.898 | 24.2 | 0.880 | 0.802 | 0.937 |
| Jeveration (original), this harness | 0.733 | 28.05 | 77.76 | 67.6 | 0.267 | 0.898 | 24.2 | 0.758 | 0.769 | 0.749 |
| Teveration 1 small, this harness | 0.706 | 27.68 | 77.08 | 65.9 | 0.283 | 0.881 | 25.4 | 0.743 | 0.751 | 0.741 |
| Teveration 1 balanced, this harness | 0.715 | 27.91 | 77.71 | 66.8 | 0.278 | 0.888 | 25.0 | 0.746 | 0.764 | 0.745 |
| Teveration 1 high, this harness | 0.721 | 27.97 | 77.85 | 67.0 | 0.275 | 0.890 | 24.9 | 0.750 | 0.755 | 0.746 |
## Protocol
- Random state and sampling draw of every picture are made from the request's number and shared by all models.
- GenEval: detector is facebook/mask2former-swin-small-coco-instance run through transformers with mmdet's instance post-processing (the official script uses mmdet's own retraining of the same network); thresholds, counting, colour and position rules are the official ones.
- HPSv2.1: HPS_v2.1_compressed.pt on the four HPDv2 benchmark styles, 800 prompts each, one picture per prompt; mean of the four.
- DPG-Bench: official questions and scoring rule with the mPLUG VQA model, four pictures per prompt.
- NYUv2: the 654 test pictures at 288 x 384 with 13 classes (the multi-task version of the set); mIoU from the confusion matrix of the whole set, depth and normals over valid pixels.
- Image-to-image: 341 COCO val2017 photos with their first caption. The condition (HED edges, Depth Anything V2 depth, grey picture) is computed from the photo; the output's structure is compared with the photo's. The paper's own held-out set and its paired style targets are not published, so its style PSNR is not measured.
## Against the original, request by request
- Teveration 1 small: geneval: mean difference -0.0298 (standard error 0.0077, n 2212); hps: mean difference -0.3736 (standard error 0.0330, n 3200); dpg: mean difference -0.6728 (standard error 0.3364, n 1065)
- Teveration 1 balanced: geneval: mean difference -0.0190 (standard error 0.0072, n 2212); hps: mean difference -0.1382 (standard error 0.0315, n 3200); dpg: mean difference -0.0463 (standard error 0.3052, n 1065)
- Teveration 1 high: geneval: mean difference -0.0127 (standard error 0.0071, n 2212); hps: mean difference -0.0820 (standard error 0.0302, n 3200); dpg: mean difference +0.0978 (standard error 0.3075, n 1065)54 unmodified lines5556575859606162636465661 unmodified line68697071727374757677787980259 unmodified lines3403413423433443453463479 unmodified lines35735835936036136236336454 unmodified linesos.replace(tmp, path)def resolve_model(model=None, vision=True, quality="balanced"):"""-> (folder with the model's parts, quality). model: a one-file model (Teveration-1-<quality>.gguf), a folder that holdsone, a folder with the four parts, or None: then the one-file model of this quality is downloaded from Hugging Face."""model = model or os.environ.get("TEVERATION_MODEL")if model and os.path.isfile(model):return unpack_single(model, vision)if model and os.path.isdir(model):names = [n for k, n in list(GGUF.items()) + [("adapter", ADAPTERS[quality])] if vision or k != "mmproj"]if all(os.path.exists(os.path.join(model, n)) for n in names):1 unmodified lineif model is None:try: # the standard Hugging Face cache, shared with every other toolfrom huggingface_hub import hf_hub_downloadreturn unpack_single(hf_hub_download(HF_REPO, SINGLE[quality]), vision)except ImportError:model = os.path.join(cache_dir(), "model")path = os.path.join(model, SINGLE[quality])if not os.path.exists(path):_download(f"https://huggingface.co/{HF_REPO}/resolve/main/{SINGLE[quality]}", path, SINGLE[quality])return unpack_single(path, vision)def find_model(folder=None, vision=True, quality="balanced"):259 unmodified linesquality: small (2.6 GB), balanced (2.8 GB) or high (3.1 GB): the precision of the low-rank path. A file given asmodel decides the quality itself."""assert quality in ADAPTERS, f"quality must be one of {tuple(ADAPTERS)}"self.folder, quality = resolve_model(model, vision, quality)self.quality = qualityself.lib = L = self._open(lib, device)c, u8p, i32p, f32p = ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_float)L.tev_load.restype = ctypes.c_void_p9 unmodified linesL.tev_dense_predict.argtypes = [ctypes.c_void_p, u8p, ctypes.c_int, ctypes.c_int, u8p, f32p, f32p]L.tev_decode.argtypes = [ctypes.c_void_p, i32p, c, u8p]L.tev_decode_source.argtypes = [ctypes.c_void_p, i32p, u8p, c, c, u8p]p = lambda key: os.path.join(self.folder, ADAPTERS[quality] if key == "adapter" else GGUF[key]).encode() # noqa: E731self.h = L.tev_load(p("backbone"), p("adapter"), p("image"), p("mmproj") if vision else None, 0 if device == "cpu" else 1, int(threads))if not self.h:raise RuntimeError("teveration: " + L.tev_last_error().decode(errors="replace"))self.backend = L.tev_backend(self.h).decode()54 unmodified lines555657585960616263646566671 unmodified line697071727374757677787980818283848586878889909192939495259 unmodified lines3553563573583593603619 unmodified lines37137237337437537637737837938038138238338438538654 unmodified linesos.replace(tmp, path)def locate_model(model=None, vision=True, quality="balanced"):"""-> (path, quality): the one-file model, or a folder with the four parts. model: a one-file model(Teveration-1-<quality>.gguf), a folder that holds one, a folder with the four parts, or None: then the one-file model ofthis quality is downloaded from Hugging Face."""model = model or os.environ.get("TEVERATION_MODEL")if model and os.path.isfile(model):return model, _kv_get(gguf_header(model), "single.quality") or qualityif model and os.path.isdir(model):names = [n for k, n in list(GGUF.items()) + [("adapter", ADAPTERS[quality])] if vision or k != "mmproj"]if all(os.path.exists(os.path.join(model, n)) for n in names):1 unmodified lineif model is None:try: # the standard Hugging Face cache, shared with every other toolfrom huggingface_hub import hf_hub_downloadreturn hf_hub_download(HF_REPO, SINGLE[quality]), qualityexcept ImportError:model = os.path.join(cache_dir(), "model")path = os.path.join(model, SINGLE[quality])if not os.path.exists(path):_download(f"https://huggingface.co/{HF_REPO}/resolve/main/{SINGLE[quality]}", path, SINGLE[quality])return path, qualitydef resolve_model(model=None, vision=True, quality="balanced"):"""-> (folder with the model's four parts, quality): for engines older than 1.0.1, which cannot read a one-file model inplace. The parts of a one-file model are written to the cache."""path, quality = locate_model(model, vision, quality)return (path, quality) if os.path.isdir(path) else unpack_single(path, vision)def reads_single(lib):"""True when this engine library reads one-file models in place (1.0.1 on)"""import mmapwith open(lib, "rb") as f, mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as m:return m.find(b"tev_load_file") >= 0def find_model(folder=None, vision=True, quality="balanced"):259 unmodified linesquality: small (2.6 GB), balanced (2.8 GB) or high (3.1 GB): the precision of the low-rank path. A file given asmodel decides the quality itself."""assert quality in ADAPTERS, f"quality must be one of {tuple(ADAPTERS)}"self.path, self.quality = locate_model(model, vision, quality)self.lib = L = self._open(lib, device)c, u8p, i32p, f32p = ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_float)L.tev_load.restype = ctypes.c_void_p9 unmodified linesL.tev_dense_predict.argtypes = [ctypes.c_void_p, u8p, ctypes.c_int, ctypes.c_int, u8p, f32p, f32p]L.tev_decode.argtypes = [ctypes.c_void_p, i32p, c, u8p]L.tev_decode_source.argtypes = [ctypes.c_void_p, i32p, u8p, c, c, u8p]gpu = 0 if device == "cpu" else 1if os.path.isfile(self.path) and hasattr(L, "tev_load_file"): # read in place: nothing is unpackedL.tev_load_file.restype = ctypes.c_void_pL.tev_load_file.argtypes = [c, ctypes.c_int, ctypes.c_int, ctypes.c_int]self.folder = os.path.dirname(self.path)self.h = L.tev_load_file(self.path.encode(), int(bool(vision)), gpu, int(threads))else: # a folder with the parts, or an engine before 1.0.1self.folder, quality = resolve_model(self.path, vision, self.quality)p = lambda key: os.path.join(self.folder, ADAPTERS[quality] if key == "adapter" else GGUF[key]).encode() # noqa: E731self.h = L.tev_load(p("backbone"), p("adapter"), p("image"), p("mmproj") if vision else None, gpu, int(threads))if not self.h:raise RuntimeError("teveration: " + L.tev_last_error().decode(errors="replace"))self.backend = L.tev_backend(self.h).decode()
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106{
"original": {
"geneval": 0.7333822265205243,
"pictures": 341,
"correct_pictures": 0.7237793851717902,
"hps": 28.05123056739103,
"dpg": 77.7568561235108,
"prompts": 1065,
"miou": 67.62443177980256,
"pixel_acc": 84.76888043950792,
"depth_abs": 0.2665058399047642,
"depth_rel": 0.10644313276089444,
"delta1": 0.8975960322734964,
"normal_mean": 24.15477478160542,
"normal_median": 18.4977272121033,
"normal_within_11": 0.31827890174854206,
"normal_within_22": 0.5802607765661117,
"normal_within_30": 0.7001664378473121,
"i2i_hed": 0.7578742032998499,
"i2i_depth": 0.769240986217152,
"i2i_colorize": 0.7487380151783951
},
"small": {
"geneval": 0.7058596604341285,
"pictures": 341,
"correct_pictures": 0.6939421338155516,
"hps": 27.677616400644183,
"dpg": 77.08412120471361,
"prompts": 1065,
"miou": 65.85042783284833,
"pixel_acc": 84.0699405955743,
"depth_abs": 0.28268001850108415,
"depth_rel": 0.11323457179755647,
"delta1": 0.8811506805873056,
"normal_mean": 25.409552997230744,
"normal_median": 20.26772447320243,
"normal_within_11": 0.2848335739115663,
"normal_within_22": 0.5447839564957488,
"normal_within_30": 0.6725773944513215,
"i2i_hed": 0.7428320702330873,
"i2i_depth": 0.7506388331438439,
"i2i_colorize": 0.7413579710556975
},
"balanced": {
"geneval": 0.7148161804212337,
"pictures": 341,
"correct_pictures": 0.7047920433996383,
"hps": 27.913010168122128,
"dpg": 77.71063128242173,
"prompts": 1065,
"miou": 66.78106354299635,
"pixel_acc": 84.4391699809034,
"depth_abs": 0.27761448469931344,
"depth_rel": 0.11106745316965273,
"delta1": 0.887509534753586,
"normal_mean": 25.048117322892956,
"normal_median": 19.724079633342644,
"normal_within_11": 0.29492226536985233,
"normal_within_22": 0.5556000884709595,
"normal_within_30": 0.6809695717635901,
"i2i_hed": 0.7464102993775251,
"i2i_depth": 0.7639840537152333,
"i2i_colorize": 0.7450425953478328
},
"high": {
"geneval": 0.7205783678988467,
"pictures": 341,
"correct_pictures": 0.711121157323689,
"hps": 27.96922521200031,
"dpg": 77.854637353494,
"prompts": 1065,
"miou": 66.9842394797016,
"pixel_acc": 84.50194735259258,
"depth_abs": 0.27474924955333113,
"depth_rel": 0.10939360335154398,
"delta1": 0.890303886192493,
"normal_mean": 24.873103587829107,
"normal_median": 19.604248969812947,
"normal_within_11": 0.2975949873906154,
"normal_within_22": 0.5582123745921543,
"normal_within_30": 0.6837311403966985,
"i2i_hed": 0.749548552456003,
"i2i_depth": 0.7550207904357015,
"i2i_colorize": 0.7463359537956525
},
"paper": {
"geneval": 0.74,
"hps": 28.06,
"dpg": 78.24,
"miou": 67.7,
"depth_abs": 0.267,
"delta1": 0.898,
"normal_mean": 24.2,
"i2i_hed": 0.88,
"i2i_depth": 0.802,
"i2i_colorize": 0.937
},
"protocol": [
"Random state and sampling draw of every picture are made from the request's number and shared by all models.",
"GenEval: detector is facebook/mask2former-swin-small-coco-instance run through transformers with mmdet's instance post-processing (the official script uses mmdet's own retraining of the same network); thresholds, counting, colour and position rules are the official ones.",
"HPSv2.1: HPS_v2.1_compressed.pt on the four HPDv2 benchmark styles, 800 prompts each, one picture per prompt; mean of the four.",
"DPG-Bench: official questions and scoring rule with the mPLUG VQA model, four pictures per prompt.",
"NYUv2: the 654 test pictures at 288 x 384 with 13 classes (the multi-task version of the set); mIoU from the confusion matrix of the whole set, depth and normals over valid pixels.",
"Image-to-image: 341 COCO val2017 photos with their first caption. The condition (HED edges, Depth Anything V2 depth, grey picture) is computed from the photo; the output's structure is compared with the photo's. The paper's own held-out set and its paired style targets are not published, so its style PSNR is not measured."
]
}47 unmodified lines4849505152535455565758591 unmodified line61626364656667686970717273259 unmodified lines3333343353363373383393409 unmodified lines35035135235335435535635747 unmodified linesos.replace(tmp, path)def resolve_model(model=None, vision=True, quality="balanced"):"""-> (folder with the model's parts, quality). model: a one-file model (Teveration-1-<quality>.gguf), a folder that holdsone, a folder with the four parts, or None: then the one-file model of this quality is downloaded from Hugging Face."""model = model or os.environ.get("TEVERATION_MODEL")if model and os.path.isfile(model):return unpack_single(model, vision)if model and os.path.isdir(model):names = [n for k, n in list(GGUF.items()) + [("adapter", ADAPTERS[quality])] if vision or k != "mmproj"]if all(os.path.exists(os.path.join(model, n)) for n in names):1 unmodified lineif model is None:try: # the standard Hugging Face cache, shared with every other toolfrom huggingface_hub import hf_hub_downloadreturn unpack_single(hf_hub_download(HF_REPO, SINGLE[quality]), vision)except ImportError:model = os.path.join(cache_dir(), "model")path = os.path.join(model, SINGLE[quality])if not os.path.exists(path):_download(f"https://huggingface.co/{HF_REPO}/resolve/main/{SINGLE[quality]}", path, SINGLE[quality])return unpack_single(path, vision)def find_model(folder=None, vision=True, quality="balanced"):259 unmodified linesquality: small (2.6 GB), balanced (2.8 GB) or high (3.1 GB): the precision of the low-rank path. A file given asmodel decides the quality itself."""assert quality in ADAPTERS, f"quality must be one of {tuple(ADAPTERS)}"self.folder, quality = resolve_model(model, vision, quality)self.quality = qualityself.lib = L = self._open(lib, device)c, u8p, i32p, f32p = ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_float)L.tev_load.restype = ctypes.c_void_p9 unmodified linesL.tev_dense_predict.argtypes = [ctypes.c_void_p, u8p, ctypes.c_int, ctypes.c_int, u8p, f32p, f32p]L.tev_decode.argtypes = [ctypes.c_void_p, i32p, c, u8p]L.tev_decode_source.argtypes = [ctypes.c_void_p, i32p, u8p, c, c, u8p]p = lambda key: os.path.join(self.folder, ADAPTERS[quality] if key == "adapter" else GGUF[key]).encode() # noqa: E731self.h = L.tev_load(p("backbone"), p("adapter"), p("image"), p("mmproj") if vision else None, 0 if device == "cpu" else 1, int(threads))if not self.h:raise RuntimeError("teveration: " + L.tev_last_error().decode(errors="replace"))self.backend = L.tev_backend(self.h).decode()47 unmodified lines484950515253545556575859601 unmodified line626364656667686970717273747576777879808182838485868788259 unmodified lines3483493503513523533549 unmodified lines36436536636736836937037137237337437537637737837947 unmodified linesos.replace(tmp, path)def locate_model(model=None, vision=True, quality="balanced"):"""-> (path, quality): the one-file model, or a folder with the four parts. model: a one-file model(Teveration-1-<quality>.gguf), a folder that holds one, a folder with the four parts, or None: then the one-file model ofthis quality is downloaded from Hugging Face."""model = model or os.environ.get("TEVERATION_MODEL")if model and os.path.isfile(model):return model, _kv_get(gguf_header(model), "single.quality") or qualityif model and os.path.isdir(model):names = [n for k, n in list(GGUF.items()) + [("adapter", ADAPTERS[quality])] if vision or k != "mmproj"]if all(os.path.exists(os.path.join(model, n)) for n in names):1 unmodified lineif model is None:try: # the standard Hugging Face cache, shared with every other toolfrom huggingface_hub import hf_hub_downloadreturn hf_hub_download(HF_REPO, SINGLE[quality]), qualityexcept ImportError:model = os.path.join(cache_dir(), "model")path = os.path.join(model, SINGLE[quality])if not os.path.exists(path):_download(f"https://huggingface.co/{HF_REPO}/resolve/main/{SINGLE[quality]}", path, SINGLE[quality])return path, qualitydef resolve_model(model=None, vision=True, quality="balanced"):"""-> (folder with the model's four parts, quality): for engines older than 1.0.1, which cannot read a one-file model inplace. The parts of a one-file model are written to the cache."""path, quality = locate_model(model, vision, quality)return (path, quality) if os.path.isdir(path) else unpack_single(path, vision)def reads_single(lib):"""True when this engine library reads one-file models in place (1.0.1 on)"""import mmapwith open(lib, "rb") as f, mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as m:return m.find(b"tev_load_file") >= 0def find_model(folder=None, vision=True, quality="balanced"):259 unmodified linesquality: small (2.6 GB), balanced (2.8 GB) or high (3.1 GB): the precision of the low-rank path. A file given asmodel decides the quality itself."""assert quality in ADAPTERS, f"quality must be one of {tuple(ADAPTERS)}"self.path, self.quality = locate_model(model, vision, quality)self.lib = L = self._open(lib, device)c, u8p, i32p, f32p = ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_float)L.tev_load.restype = ctypes.c_void_p9 unmodified linesL.tev_dense_predict.argtypes = [ctypes.c_void_p, u8p, ctypes.c_int, ctypes.c_int, u8p, f32p, f32p]L.tev_decode.argtypes = [ctypes.c_void_p, i32p, c, u8p]L.tev_decode_source.argtypes = [ctypes.c_void_p, i32p, u8p, c, c, u8p]gpu = 0 if device == "cpu" else 1if os.path.isfile(self.path) and hasattr(L, "tev_load_file"): # read in place: nothing is unpackedL.tev_load_file.restype = ctypes.c_void_pL.tev_load_file.argtypes = [c, ctypes.c_int, ctypes.c_int, ctypes.c_int]self.folder = os.path.dirname(self.path)self.h = L.tev_load_file(self.path.encode(), int(bool(vision)), gpu, int(threads))else: # a folder with the parts, or an engine before 1.0.1self.folder, quality = resolve_model(self.path, vision, self.quality)p = lambda key: os.path.join(self.folder, ADAPTERS[quality] if key == "adapter" else GGUF[key]).encode() # noqa: E731self.h = L.tev_load(p("backbone"), p("adapter"), p("image"), p("mmproj") if vision else None, gpu, int(threads))if not self.h:raise RuntimeError("teveration: " + L.tev_last_error().decode(errors="replace"))self.backend = L.tev_backend(self.h).decode()
.gitattributes+4
README.md+43-2
STANDARD_BENCHMARKS.mdAdded+26
images/standard_dpg.jpgAdded

Large File Pointer Details
- SHA256: 5d78268bbdc8462d03c9b7b60aabb723dccc4cbc2fe29bd021fb52acd61d00f1
- Pointer size: 131 Bytes
- Size of remote file: 754 kB
images/standard_geneval.jpgAdded

Large File Pointer Details
- SHA256: 7689e29b23df32f2dcb0bafab95b92f760cc1bacb7ae15f51f1804e0ee1f0a69
- Pointer size: 131 Bytes
- Size of remote file: 562 kB
images/standard_hps.jpgAdded

Large File Pointer Details
- SHA256: cd7111cbf06de0b2ca0f89ecda36d95635063c3918377fce379eeb25f4433fda
- Pointer size: 131 Bytes
- Size of remote file: 644 kB
images/standard_i2i.jpgAdded

Large File Pointer Details
- SHA256: a17b5de38a155fee9c7ae0ca59305b93751bcc0276832bd01b1b8058c01aeae6
- Pointer size: 131 Bytes
- Size of remote file: 918 kB
pipeline.py+32-10
standard_metrics.jsonAdded+106
teveration_engine.py+32-10