Run this model with HF Jobs
Run AquilaX-AI/Review 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/AquilaX-AI/Review. 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/AquilaX-AI/Review 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 AquilaX-AI/Review with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AquilaX-AI/Review with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AquilaX-AI/Review")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AquilaX-AI/Review") model = AutoModelForSequenceClassification.from_pretrained("AquilaX-AI/Review", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Inference
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import time
import torch
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = AutoModelForSequenceClassification.from_pretrained("AquilaX-AI/Review").to(device)
tokenizer = AutoTokenizer.from_pretrained("AquilaX-AI/Review")
partial_code = "if (userInput.length > 255) { return; }" # Example snippet of insecure code
cwe_id = "CWE-22" # Example CWE ID for Path Traversal
cwe_name = "Improper Limitation of a Pathname to a Restricted Directory" # Example CWE Name
affected_line = "42" # Example line number in the code file
file_name = "utils/inputValidator.js" # Example file name
org_id = "12345" # Example organization ID
start = time.time()
prompt = f"""partial_code: {partial_code} , cwe_id: {cwe_id} , cwe_name: {cwe_name}, affected_line: {affected_line},file_name: {file_name}, org_id: {org_id}"""
inputs = tokenizer(prompt, return_tensors="pt").to(device)
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
predicted_class = model.config.id2label[predicted_class_id]
print(predicted_class)
print(time.time() - start)
- Downloads last month
- 158