Instructions to use CodesBee/DeQARAG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use CodesBee/DeQARAG with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "CodesBee/DeQARAG") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from CodesBee/DeQARAG: direct link, hf CLI and curl.
- Browser
- Download file 3.37 kB
-
https://huggingface.co/CodesBee/DeQARAG/resolve/main/README.md
- Command line
-
hf download hf://CodesBee/DeQARAG/README.md
-
curl -L -o README.md https://huggingface.co/CodesBee/DeQARAG/resolve/main/README.md
3.37 kB
| base_model: Qwen/Qwen3-4B-Instruct-2507 | |
| base_model_relation: adapter | |
| library_name: peft | |
| license: apache-2.0 | |
| pipeline_tag: text-generation | |
| language: | |
| - en | |
| tags: | |
| - lora | |
| - query-decomposition | |
| - multi-hop-question-answering | |
| # DeQA-RAG question decomposer | |
| This repository contains the trained LoRA adapter used by DeQA-RAG to turn an original question into useful supporting questions. It requires the [Qwen3-4B-Instruct-2507 base model](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507), using base revision `cdbee75f17c01a7cc42f958dc650907174af0554`. | |
| The adapter contains 66,060,288 parameters stored as 504 float32 tensors. It applies ordinary LoRA with rank 32, alpha 64 and dropout 0.05 to the attention and MLP projections. The base weights are loaded separately in bfloat16. | |
| ## Input and output | |
| Use the included `decomposition.txt` as the system message and the original question as the user message, with the base tokenizer's native chat template. Preserve the prompt text, including its final newline. | |
| The output is a JSON array of supporting-question strings. Each question preserves its identifying description so it can be retrieved independently. The output contains no answers or references such as `#1`. An empty array is allowed. DeQA-RAG separately retrieves and answers the original question after the supporting questions. | |
| Use greedy generation: `do_sample=False`, `num_beams=1`, `max_new_tokens=1024`, seed 1729, and SDPA attention. The DeQA-RAG loader explicitly sets its generation configuration to avoid inheriting sampling defaults. | |
| ## Loading | |
| After installing the DeQA-RAG project with its model dependencies: | |
| ```python | |
| from deqa.decompose import Decomposer | |
| decompose = Decomposer("CodesBee/DeQARAG") | |
| questions = decompose("Who owns the company where the composer of Song S works?") | |
| print(questions) | |
| ``` | |
| The underlying PEFT loading pattern is: | |
| ```python | |
| import torch | |
| from peft import PeftModel | |
| from transformers import AutoModelForCausalLM | |
| base = AutoModelForCausalLM.from_pretrained( | |
| "Qwen/Qwen3-4B-Instruct-2507", | |
| revision="cdbee75f17c01a7cc42f958dc650907174af0554", | |
| dtype=torch.bfloat16, attn_implementation="sdpa", | |
| ).to("cuda") | |
| model = PeftModel.from_pretrained(base, "CodesBee/DeQARAG").eval() | |
| ``` | |
| ## Training and evaluation scope | |
| The project training examples combine BREAK-high sources, HotpotQA, 2WikiMultiHopQA, MuSiQue and explicitly authored synthetic coverage examples. The project author led the design, development and review of the supporting-question annotations. | |
| The released weights continue an existing ordinary LoRA for 40 additional optimizer updates. This continuation combines existing decomposition examples with native coverage questions and explicitly marked synthetic examples. | |
| This adapter was developed for the project's English multi-hop QA experiments. Generated questions can omit prerequisites or change the meaning of a relation. DeQA-RAG's evaluation package includes the original saved supporting questions for its fixed evaluation pool; use those files when reproducing that evaluation. | |
| The adapter is released under Apache-2.0. The [base model's Apache-2.0 license](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507/blob/cdbee75f17c01a7cc42f958dc650907174af0554/LICENSE) also applies to its original materials. | |