Text Classification
Transformers
Safetensors
decision-model
classification
julia
open-jev
head-finetune
low-resource
Instructions to use SHSLab/Qyvos with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SHSLab/Qyvos with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="SHSLab/Qyvos")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SHSLab/Qyvos", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Qyvos v1: Julia-1 backbone (bit-exact) + Open-Jev head fine-tune (30k rows, low-RAM protocol)
31f7037 verified Download julia/cuda.py from SHSLab/Qyvos: direct link, hf CLI and curl.
- Browser
- Download file 2.31 kB
-
https://huggingface.co/SHSLab/Qyvos/resolve/main/julia/cuda.py
- Command line
-
hf download hf://SHSLab/Qyvos/julia/cuda.py
-
curl -L -o cuda.py https://huggingface.co/SHSLab/Qyvos/resolve/main/julia/cuda.py
2.31 kB
| """CUDA configuration and explicit environment diagnostics for the L40S path.""" | |
| import importlib.metadata | |
| import json | |
| import os | |
| import platform | |
| import torch | |
| def configure(device_name='cuda', precision='bf16', seed=42): | |
| device = torch.device(device_name) | |
| if device.type == 'cuda' and device.index is None: | |
| device = torch.device('cuda', 0) | |
| if device.type == 'cuda' and not torch.cuda.is_available(): | |
| raise RuntimeError('CUDA requested but unavailable. Run nvidia-smi and install the CUDA PyTorch wheel; CPU fallback is disabled.') | |
| if precision == 'bf16' and device.type == 'cuda' and not torch.cuda.is_bf16_supported(): | |
| raise RuntimeError('This CUDA device does not support BF16; select --precision fp32.') | |
| torch.set_num_threads(int(os.environ.get('JULIA_CPU_THREADS', '4'))) | |
| torch.manual_seed(seed) | |
| if device.type == 'cuda': | |
| torch.cuda.set_device(device) | |
| torch.cuda.manual_seed_all(seed) | |
| torch.backends.cuda.matmul.allow_tf32 = True | |
| torch.backends.cudnn.allow_tf32 = True | |
| torch.cuda.reset_peak_memory_stats(device) | |
| torch.set_float32_matmul_precision('high') | |
| return device | |
| def environment(device): | |
| result = dict(python=platform.python_version(), torch=str(torch.__version__), cuda=torch.version.cuda, | |
| transformers=importlib.metadata.version('transformers'), device=str(device)) | |
| if device.type == 'cuda': | |
| prop = torch.cuda.get_device_properties(device) | |
| result.update(gpu=prop.name, vram_bytes=prop.total_memory, | |
| compute_capability=list(torch.cuda.get_device_capability(device))) | |
| return result | |
| def move(batch, device): | |
| return {k: v.to(device, non_blocking=device.type == 'cuda') for k, v in batch.items()} | |
| def main(): | |
| device = configure() | |
| x = torch.randn(512, 512, device=device, dtype=torch.bfloat16, requires_grad=True) | |
| (x @ x.T).float().square().mean().backward() | |
| torch.cuda.synchronize() | |
| report = environment(device) | |
| report['bf16_forward_backward_finite'] = bool(torch.isfinite(x.grad).all()) | |
| print(json.dumps(report, indent=2)) | |
| if not report['bf16_forward_backward_finite']: | |
| raise RuntimeError('CUDA BF16 diagnostic produced nonfinite gradients') | |
| if __name__ == '__main__': | |
| main() | |