Run this model with HF Jobs

Run TeraSpace/replica_classification 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/TeraSpace/replica_classification. 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/TeraSpace/replica_classification 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.

TeraSpace/replica_classification

Сделано на основе xlm-roberta-base

  1. dialog - реагирует на диалоговые реплики. Например, "привет"
  2. trouble - реагирует на реплики, где пользователь рассказывает о своих проблемах. Например, "у меня болит зуб, мне проткнули колесо"
  3. question - реагирует на вопрос не относящийся к диалогу, например: "когда родился пушкин" или "когда я стану миллионером"
  4. about_user - реагирует, когда пользователь говорит о себе. Например, "меня зовут андрей"
  5. about_model - реагирует на вопросы о личности ассистента. Например, "как тебя зовут, ты кто такая"
  6. instruct - реагирует на вопросы, ответ на которые представляет собой инструкцию. Например, "как установить windows, как приготовить борщ"

Использование

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

del_symbs = ["?","!",".",","]
classes = ["dialog","trouble","question","about_user","about_model","instruct"]

device = torch.device("cuda")
model_name = 'TeraSpace/replica_classification'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels = len(classes)).to(device)

while True:
    text = input("=>").lower()
    for del_symb in del_symbs:
        text = text.replace(del_symb,"")
        
    inputs = tokenizer(text, truncation=True, max_length=512, padding='max_length',
                            return_tensors='pt').to(device)
    with torch.no_grad():
        logits = model(**inputs).logits
        probas = list(torch.sigmoid(logits)[0].cpu().detach().numpy())
        
    out = classes[probas.index(max(probas))]
    print(out)
Downloads last month
6
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support