captivea_odoo β€” Fine-tuning Project

This project fine-tunes a small open-source LLM on Odoo-related text (docs, tickets, code notes, whatever you provide) and pushes the result to your Hugging Face repo captivea_odoo.

Important reality check first

A single fine-tuned LLM does not natively do PDF parsing, text generation, AND image generation. Those are three different jobs:

Need What actually handles it
Text generation (Odoo Q&A, docs, summaries) This fine-tuned LLM
PDF understanding A PDF text-extraction step (pypdf) feeding text into the LLM, or a RAG pipeline β€” not a fine-tuning concern
Image generation A separate image model (e.g. Stable Diffusion / FLUX) called alongside the LLM β€” LLMs don't generate pixels

This project builds the text generation piece properly. The prepare_data.py script also lets you feed in PDFs as training source material (extracting their text), but that's different from the model being able to "read PDFs" at inference time β€” for that you want a RAG setup (see the note at the bottom of this file).

1. Environment setup

Run this on a machine with a GPU (a Colab notebook with a T4/A100, or any cloud GPU box β€” this will not run fine-tuning on CPU in reasonable time).

pip install -r requirements.txt
huggingface-cli login --token $HF_TOKEN

2. Add your Odoo training data

Drop your source material into data/raw/:

  • .txt or .md files β€” Odoo documentation, internal wiki exports, etc.
  • .pdf files β€” manuals, SOPs (text will be extracted automatically)
  • .jsonl β€” if you already have instruction/response pairs, format:
    {"instruction": "How do I create a new sales order in Odoo?", "response": "Go to Sales > Orders > New..."}
    

Then run:

python prepare_data.py

This produces data/train.jsonl in instruction/response format, ready for fine-tuning. Review it before training β€” model quality depends entirely on this data being clean and accurate.

3. Fine-tune

python train.py --base_model Qwen/Qwen2.5-1.5B-Instruct --output_dir ./captivea_odoo_lora

Defaults to Qwen2.5-1.5B-Instruct because it's small enough to fine-tune on a single free-tier Colab GPU. For better quality with more GPU budget, swap in mistralai/Mistral-7B-Instruct-v0.3 or meta-llama/Llama-3.1-8B-Instruct (both gated β€” you'll need to accept their license on Hugging Face first).

This uses LoRA (via peft), so it trains a small adapter rather than the full model β€” much cheaper, and the adapter can be merged into the base model or kept separate.

4. Push to your captivea_odoo Hugging Face repo

Training already pushes automatically at the end (see train.py), or push manually:

python -c "
from huggingface_hub import HfApi
api = HfApi()
api.upload_folder(
    folder_path='./captivea_odoo_lora',
    repo_id='yatri-modi/captivea_odoo',  # replace with your actual username/repo
    repo_type='model'
)
"

5. Try it

python inference.py --prompt "How do I set up a multi-warehouse routing in Odoo?"

About PDF and image generation, properly

  • PDFs at inference time: don't fine-tune for this β€” build a small RAG layer instead (extract PDF text β†’ embed with sentence-transformers β†’ store in a vector store like chromadb β†’ retrieve relevant chunks β†’ feed them into this model's prompt as context). Say the word and I'll write that pipeline too β€” it's a separate, smaller project.
  • Image generation: call an image model (e.g. Stable Diffusion XL via diffusers, or an API) as its own step, triggered whenever the user asks for a diagram/image. It isn't something this LLM fine-tune adds.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support