Text Classification
Transformers
Safetensors
PEFT
branchone
feature-extraction
decision-model
multimodal
custom-code
custom_code
Instructions to use ndemirdemir/BranchOne with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ndemirdemir/BranchOne with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ndemirdemir/BranchOne", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ndemirdemir/BranchOne", trust_remote_code=True, device_map="auto") - PEFT
How to use ndemirdemir/BranchOne with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Download cuda_toolchain.py from ndemirdemir/BranchOne: direct link, hf CLI and curl.
- Browser
- Download file 2.05 kB
-
https://huggingface.co/ndemirdemir/BranchOne/resolve/main/cuda_toolchain.py
- Command line
-
hf download hf://ndemirdemir/BranchOne/cuda_toolchain.py
-
curl -L -o cuda_toolchain.py https://huggingface.co/ndemirdemir/BranchOne/resolve/main/cuda_toolchain.py
2.05 kB
| """Select CUDA 12.8 for extension builds, independently of the runtime driver.""" | |
| import os | |
| import re | |
| import subprocess | |
| from pathlib import Path | |
| PACKAGES = [ | |
| "cuda-nvcc-12-8=12.8.93-1", | |
| "cuda-cudart-dev-12-8=12.8.90-1", | |
| "cuda-cccl-12-8=12.8.90-1", | |
| ] | |
| def compiler_version(home): | |
| compiler = Path(home) / "bin/nvcc" | |
| if not compiler.is_file(): | |
| return None | |
| result = subprocess.run( | |
| [str(compiler), "--version"], capture_output=True, text=True, check=True | |
| ) | |
| match = re.search(r"release (\d+\.\d+),", result.stdout) | |
| return match.group(1) if match else None | |
| def configure(*, install=False): | |
| candidates = [os.environ.get("CUDA_HOME"), "/usr/local/cuda-12.8"] | |
| selected = next( | |
| (Path(p) for p in candidates if p and compiler_version(p) == "12.8"), | |
| None, | |
| ) | |
| if selected is None and install: | |
| if os.geteuid() != 0: | |
| raise RuntimeError( | |
| "Install CUDA 12.8 development tools and set CUDA_HOME before setup" | |
| ) | |
| # Colab provides NVIDIA's signed Ubuntu repository. Install compiler and | |
| # development headers only; leave the runtime's GPU driver in place. | |
| subprocess.run(["apt-get", "update", "-qq"], check=True) | |
| subprocess.run( | |
| ["apt-get", "install", "-y", "--no-install-recommends", *PACKAGES], | |
| check=True, | |
| env=os.environ | {"DEBIAN_FRONTEND": "noninteractive"}, | |
| ) | |
| selected = Path("/usr/local/cuda-12.8") | |
| if selected is None or compiler_version(selected) != "12.8": | |
| raise RuntimeError( | |
| "The extension requires a CUDA 12.8 compiler to match Torch cu128; " | |
| "run setup_colab.py or set CUDA_HOME to a CUDA 12.8 toolkit" | |
| ) | |
| os.environ["CUDA_HOME"] = str(selected) | |
| os.environ["PATH"] = str(selected / "bin") + os.pathsep + os.environ["PATH"] | |
| version = subprocess.check_output( | |
| [str(selected / "bin/nvcc"), "--version"], text=True | |
| ) | |
| return {"cuda_home": str(selected), "nvcc": version} | |