Run this model with HF Jobs

Run Snapmap/diffcheckstuffiused 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/Snapmap/diffcheckstuffiused. 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/Snapmap/diffcheckstuffiused 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.
diffcheckstuffiused / unet /Z-Image /src /utils /import_utils.py
Snapmap's picture
Add files using upload-large-folder tool
201ff98 verified
Raw History Blame Contribute Delete
907 Bytes
import importlib.util
import torch
def is_flash_attn_available():
return importlib.util.find_spec("flash_attn") is not None
def is_flash_attn_3_available():
return importlib.util.find_spec("flash_attn_interface") is not None
def is_torch_version(operator: str, version: str):
from packaging import version as pversion
torch_version = pversion.parse(torch.__version__)
target_version = pversion.parse(version)
# print(f"torch_version: {torch_version}, target: torch{operator}{target_version}")
if operator == ">":
return torch_version > target_version
elif operator == ">=":
return torch_version >= target_version
elif operator == "==":
return torch_version == target_version
elif operator == "<=":
return torch_version <= target_version
elif operator == "<":
return torch_version < target_version
return False