Run this model with HF Jobs
Run tytodd/test-probe 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/tytodd/test-probe. 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/tytodd/test-probe 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 tytodd/test-probe with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tytodd/test-probe with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tytodd/test-probe", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload probe.py with huggingface_hub
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041import torchimport torch.nn as nnfrom typing import Literalfrom transformers import PretrainedConfig, PreTrainedModel
class ProbeConfig(PretrainedConfig): model_type = "linear_probe"
def __init__( self, embedding_dim: int = 768, dropout: float = 0.0, layer_index: int = -1, probe_type: Literal["linear", "nonlinear"] = "linear", **kwargs, ): super().__init__(**kwargs) self.embedding_dim = embedding_dim self.dropout = dropout self.layer_index = layer_index self.probe_type = probe_type
class ProbeModel(PreTrainedModel): config_class = ProbeConfig
def __init__(self, config: ProbeConfig): super().__init__(config) self.dropout = nn.Dropout(config.dropout) if config.dropout > 0 else None self.linear = nn.Linear(config.embedding_dim, 1)
def forward( self, embeddings: torch.Tensor, **kwargs, ) -> torch.Tensor: if self.dropout is not None: embeddings = self.dropout(embeddings) logits = self.linear(embeddings) return torch.sigmoid(logits)probe.pyAdded+41