Instructions to use ik6626/Qwen3.8-27B-HIP-kernel-RL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ik6626/Qwen3.8-27B-HIP-kernel-RL with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.8-27B") model = PeftModel.from_pretrained(base_model, "ik6626/Qwen3.8-27B-HIP-kernel-RL") - Notebooks
- Google Colab
- Kaggle
Download example/functional.py from ik6626/Qwen3.8-27B-HIP-kernel-RL: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/ik6626/Qwen3.8-27B-HIP-kernel-RL/resolve/main/example/functional.py
- Command line
-
hf download hf://ik6626/Qwen3.8-27B-HIP-kernel-RL/example/functional.py
-
curl -L -o functional.py https://huggingface.co/ik6626/Qwen3.8-27B-HIP-kernel-RL/resolve/main/example/functional.py
672 Bytes
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| def module_fn(x: torch.Tensor, target: torch.Tensor) -> torch.Tensor: | |
| # Compute element-wise equality and cast to target dtype for MSE | |
| x_eq = torch.eq(x, target).to(target.dtype) | |
| return F.mse_loss(x_eq, target) | |
| class Model(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| def forward(self, x, target, fn=module_fn): | |
| return fn(x, target) | |
| batch_size = 256 | |
| height = 512 | |
| width = 1024 | |
| def get_inputs(): | |
| x = torch.randn(batch_size, height, width) | |
| target = torch.randn(batch_size, height, width) | |
| return [x, target] | |
| def get_init_inputs(): | |
| return [] |