Text Generation
PEFT
Safetensors
English
qwen3.8
qwen3_5
lora
qlora
information-extraction
relation-extraction
knowledge-graph
structured-output
tool-calling
donto
conversational
Eval Results (legacy)
Instructions to use ajaxdavis/donto-qwen3.8-27b-predicate-extractor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ajaxdavis/donto-qwen3.8-27b-predicate-extractor with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.8-27B") model = PeftModel.from_pretrained(base_model, "ajaxdavis/donto-qwen3.8-27b-predicate-extractor") - Notebooks
- Google Colab
- Kaggle
Download examples/structured_client.py from ajaxdavis/donto-qwen3.8-27b-predicate-extractor: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/ajaxdavis/donto-qwen3.8-27b-predicate-extractor/resolve/main/examples/structured_client.py
- Command line
-
hf download hf://ajaxdavis/donto-qwen3.8-27b-predicate-extractor/examples/structured_client.py
-
curl -L -o structured_client.py https://huggingface.co/ajaxdavis/donto-qwen3.8-27b-predicate-extractor/resolve/main/examples/structured_client.py
1.88 kB
| #!/usr/bin/env python3 | |
| """Forced-tool example for a running Donto-Qwen vLLM endpoint.""" | |
| from typing import Union | |
| from openai import OpenAI | |
| from pydantic import BaseModel, ConfigDict, Field | |
| class Fact(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| s: str | |
| p: str | |
| o: Union[str, int, float, bool] | |
| c: float = Field(ge=0.0, le=1.0) | |
| h: bool | |
| class Submission(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| facts: list[Fact] = Field(max_length=64) | |
| more_supported_facts: bool | |
| TOOLS = [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "submit_facts", | |
| "description": "Submit validated Donto extraction facts.", | |
| "parameters": Submission.model_json_schema(), | |
| }, | |
| } | |
| ] | |
| SOURCE = """Ari reported that the primary system failed, while the reserve | |
| system remained available. The panel postponed deployment until an independent | |
| check was complete. Vera said the postponement wasted money, but Ari argued that | |
| it protected staff.""" | |
| PROMPT = f"""Extract every atomic proposition directly supported by SOURCE. | |
| Preserve attribution, contrast, modality, and negation. Use stable ex:kebab-case | |
| entities, concise camelCase predicates, h:false for direct facts, and no prose. | |
| SOURCE: | |
| {SOURCE} | |
| """ | |
| client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="unused") | |
| response = client.chat.completions.create( | |
| model="donto-qwen", | |
| messages=[{"role": "user", "content": PROMPT}], | |
| tools=TOOLS, | |
| tool_choice={"type": "function", "function": {"name": "submit_facts"}}, | |
| temperature=0, | |
| max_tokens=1024, | |
| extra_body={"chat_template_kwargs": {"enable_thinking": False, "preserve_thinking": False}}, | |
| ) | |
| call = response.choices[0].message.tool_calls[0] | |
| submission = Submission.model_validate_json(call.function.arguments) | |
| print(submission.model_dump_json(indent=2)) | |