Views
No views yet
avsolatorio/GIST-small-Embedding-v0. It is designed to classify short text inputs and determine if they represent a Job Title (Label 1) or Everyday Text (Label 0).avsolatorio/GIST-small-Embedding-v0pipeline API. The repository includes both PyTorch (FP32) weights, FP32 ONNX, and INT8 ONNX weights for fast inference!1from transformers import pipeline
2# Load the model directly using the pipeline
3classifier = pipeline("text-classification", model="danielruss/is_job_title_gist_small")
4print(classifier("Machine Learning Engineer"))
5# Output: [{'label': 'Job title', 'score': 0.9991}]1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import AutoTokenizer, pipeline
3
4repo_id = "danielruss/is_job_title_gist_small"
5
6# Load the optimized INT8 weights
7model = ORTModelForSequenceClassification.from_pretrained(
8 repo_id,
9 subfolder="onnx",
10 file_name="model_quantized.onnx"
11)
12tokenizer = AutoTokenizer.from_pretrained(repo_id)
13
14classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
15
16# Predict
17print(classifier("Machine Learning Engineer"))
18# Output: [{'label': 'Job title', 'score': 0.9990}]1# I use the cdn, you can install via npm also...
2import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@4.2.0/+esm'
3
4let is_job_fp = await pipeline('text-classification', "danielruss/is_job_title_gist_small", { dtype: 'fp32'})
5let is_job_quantized = await pipeline('text-classification', "danielruss/is_job_title_gist_small", { quantized:'true'})
6let res_fp = await is_job_fp("Dog Catcher")
7console.log(res_fp)
8let res_q = await is_job_quantized("Dog Catcher")
9console.log(res_q)