Run this model with HF Jobs

Run bigpang/xlmr-tatoeba 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/bigpang/xlmr-tatoeba. 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/bigpang/xlmr-tatoeba 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.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

from optimum.onnxruntime import ORTModelForSequenceClassification from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline

转换 onnx 模型

def convert(path, onnx_path, onnx_path): onnx_model = ORTModelForSequenceClassification.from_pretrained(path, from_transformers=True) tokenizer = AutoTokenizer.from_pretrained(path)

onnx_model.save_pretrained(onnx_path)
tokenizer.save_pretrained(onnx_path)

加载模型,用pipeline包装

def load_model(model_name): model = AutoModelForSequenceClassification.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name) text_classification_pipeline = pipeline("text-classification", model=model, tokenizer=tokenizer) print(text_classification_pipeline('这是一个简单的demo,用来防止忘记')) return text_classification_pipeline

加载 onnx 模型,用pipeline包装

def load_onnx_model(onnx_path): lang_tokenizer = AutoTokenizer.from_pretrained(onnx_path) lang_model = ORTModelForSequenceClassification.from_pretrained(onnx_path) lang_detecter = pipeline("text-classification", model=lang_model, tokenizer=lang_tokenizer, truncation=True) print(lang_detecter('这是一个简单的demo,用来防止忘记')) return lang_detecter

Downloads last month
8
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support