Sharing fine-tune code

#1
by hashefa - opened

Hi @sherif1313 , great work!
Is it possible for you to share the fine-tuning code?

The best training is the full model, not the quantized one, and it is available on my page. If you have any questions, feel free to ask. Thank you for your message.

@sherif1313 Thank you.
I'm asking about the fine tune code itself.

BATCH_SIZE = 2
GRAD_ACCUM = 4
EPOCHS = 3
LEARNING_RATE = 2e-5
MAX_IMAGE_SIZE = 1024
FILES_PER_CHUNK = 50

Thank you
I meant some Jupyter notebook or anything more usable. I'm unsure what is the structure my data needs to be, and what process is used for fine tune.

import os
import time import glob
import torch
from PIL import Image
from torch.utils.data import Dataset, DataLoader
from transformers import (
AutoProcessor,
Qwen2_5_VLForConditionalGeneration,
DataCollatorForSeq2Seq,
get_scheduler

import gc
from qwen_vl_utils import process_vision_info
from accelerate import Accelerator
from accelerate.utils import DistributedDataParallelKwargs
from tqdm.auto import tqdm

pip install -r requirements.txt

Fundamentals

torch
transformers
accelerate
peft

For Qwen-VL

qwen-vl-utils

Image Processing

Pillow

Utilities

tqdm
numpy
pandas

Data Processing

datasets

Performance Optimization (Optional)

flash-attn

Requires a compatible GPU

bitsandbytes

Memory Management

psutil

Is this what you wanted?

I'm working with regular .py files, not Jupyter Notebook.

Can you share the code itself?

Sign up or log in to comment