Run this model with HF Jobs
Run Loria-MosAIk/xqdt-e2e-llama3.2-1b 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/Loria-MosAIk/xqdt-e2e-llama3.2-1b. 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/Loria-MosAIk/xqdt-e2e-llama3.2-1b 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Loria-MosAIk/xqdt-e2e-llama3.2-1b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Loria-MosAIk/xqdt-e2e-llama3.2-1b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Loria-MosAIk/xqdt-e2e-llama3.2-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Loria-MosAIk/xqdt-e2e-llama3.2-1b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B-Instruct") model = PeftModel.from_pretrained(base_model, "Loria-MosAIk/xqdt-e2e-llama3.2-1b") - Notebooks
- Google Colab
- Kaggle
XQDT E2E verifier: llama 1B
This repository contains the LoRA adapter for the llama 1B
XQDT verifier from XQDT: eXplainable and Quantitative Data-Text Alignment Metric
with Feedback Signals. It is used with
meta-llama/Llama-3.2-1B-Instruct.
This E2E checkpoint was trained on the joint WebNLG--E2E synthetic training set.
Overview
XQDT verifies alignment between English text and structured triples. It returns
missing, extra, and incorrect units, or All correct. missing identifies
an input unit omitted from the text, extra identifies text content unsupported
by the input, and incorrect identifies an input unit realised with incorrect
information.
Example inputs and outputs are provided in smoke_test.json.
Generated text may vary slightly across inference libraries and package versions.
Prompt format
Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: {text}
TRIPLES:
1. [S] {subject} [P] {predicate} [O] {object}
Output as markdown table with Type and Triple columns.
ms-swift
import torch
from swift.infer_engine import InferRequest, RequestConfig, TransformersEngine
BASE_MODEL = "meta-llama/Llama-3.2-1B-Instruct"
ADAPTER_ID = "Loria-MosAIk/xqdt-e2e-llama3.2-1b"
SYSTEM_PROMPT = "Identify extra, missing and incorrect triples precisely."
QUERY = """Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: Blue Spice is a coffee shop in city centre.
TRIPLES:
1. [S] Blue Spice [P] area [O] city centre
2. [S] Blue Spice [P] eat type [O] coffee shop
Output as markdown table with Type and Triple columns."""
MESSAGES = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": QUERY}]
engine = TransformersEngine(
BASE_MODEL,
adapters=[ADAPTER_ID],
max_batch_size=1,
torch_dtype=torch.bfloat16,
device_map="auto",
template_type="llama3_2",
use_hf=True,
)
response = engine.infer(
[InferRequest(messages=MESSAGES)],
RequestConfig(max_tokens=1024, temperature=0.3, seed=2023),
use_tqdm=False,
)[0]
print(response.choices[0].message.content)
Transformers and PEFT
import torch
from peft import PeftModel
from transformers import set_seed
BASE_MODEL = "meta-llama/Llama-3.2-1B-Instruct"
ADAPTER_ID = "Loria-MosAIk/xqdt-e2e-llama3.2-1b"
SYSTEM_PROMPT = "Identify extra, missing and incorrect triples precisely."
QUERY = """Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: Blue Spice is a coffee shop in city centre.
TRIPLES:
1. [S] Blue Spice [P] area [O] city centre
2. [S] Blue Spice [P] eat type [O] coffee shop
Output as markdown table with Type and Triple columns."""
MESSAGES = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": QUERY}]
set_seed(2023)
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL, torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(base, ADAPTER_ID).eval()
prompt = tokenizer.apply_chat_template(MESSAGES, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=0.3)
generated = output[0, inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(generated, skip_special_tokens=True))
vLLM
from huggingface_hub import snapshot_download
from vllm import LLM, SamplingParams
from vllm.lora.request import LoRARequest
BASE_MODEL = "meta-llama/Llama-3.2-1B-Instruct"
ADAPTER_ID = "Loria-MosAIk/xqdt-e2e-llama3.2-1b"
SYSTEM_PROMPT = "Identify extra, missing and incorrect triples precisely."
QUERY = """Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: Blue Spice is a coffee shop in city centre.
TRIPLES:
1. [S] Blue Spice [P] area [O] city centre
2. [S] Blue Spice [P] eat type [O] coffee shop
Output as markdown table with Type and Triple columns."""
MESSAGES = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": QUERY}]
adapter_path = snapshot_download(ADAPTER_ID)
llm = LLM(model=BASE_MODEL, enable_lora=True)
outputs = llm.chat(
MESSAGES,
SamplingParams(max_tokens=1024, temperature=0.3, seed=2023),
lora_request=LoRARequest("xqdt", 1, adapter_path),
)
print(outputs[0].outputs[0].text)
Citation
Paper: Hugging Face | arXiv.
@inproceedings{efimov-zhang-etal-2026-xqdt,
title = {XQDT: eXplainable and Quantitative Data-Text Alignment Metric with Feedback Signals},
author = {Efimov-Zhang, Kun and Song, Yifei and Gardent, Claire},
booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing},
year = {2026}
}
- Downloads last month
- 29
Model tree for Loria-MosAIk/xqdt-e2e-llama3.2-1b
Base model
meta-llama/Llama-3.2-1B-Instruct