Mert

Sengil
Β·

AI & ML interests

LLM's

Recent Activity

liked a model 8 days ago
yeniguno/absa-turkish-bert-dbmdz
Reacted to ImranzamanML's post with πŸ”₯ about 1 month ago
LoRA with code πŸš€ using PEFT (parameter efficient fine-tuning) LoRA (Low-Rank Adaptation) LoRA adds low-rank matrices to specific layers and reduce the number of trainable parameters for efficient fine-tuning. Code: Please install these libraries first: pip install peft pip install datasets pip install transformers ``` from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments from peft import LoraConfig, get_peft_model from datasets import load_dataset # Loading the pre-trained BERT model model = AutoModelForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=2) # Configuring the LoRA parameters lora_config = LoraConfig( r=8, lora_alpha=16, lora_dropout=0.1, bias="none" ) # Applying LoRA to the model model = get_peft_model(model, lora_config) # Loading dataset for classification dataset = load_dataset("glue", "sst2") train_dataset = dataset["train"] # Setting the training arguments training_args = TrainingArguments( output_dir="./results", per_device_train_batch_size=16, num_train_epochs=3, logging_dir="./logs", ) # Creating a Trainer instance for fine-tuning trainer = Trainer( model=model, args=training_args, train_dataset=train_dataset, ) # Finally we can fine-tune the model trainer.train() ``` LoRA adds low-rank matrices to fine-tune only a small portion of the model and reduces training overhead by training fewer parameters. We can perform efficient fine-tuning with minimal impact on accuracy and its suitable for large models where full-precision training is still feasible.
View all activity

Organizations

None yet

Sengil's activity

Reacted to csabakecskemeti's post with πŸ‘ 5 days ago
view post
Post
1198
Some time ago, I built a predictive LLM router that routes chat requests between small and large LLM models based on prompt classification. It dynamically selects the most suitable model depending on the complexity of the user input, ensuring optimal performance while maintaining conversation context. I also fine-tuned a RoBERTa model to use with the package, but you can plug and play any classifier of your choice.

Project's homepage:
https://devquasar.com/llm-predictive-router/
Pypi:
https://pypi.org/project/llm-predictive-router/
Model:
DevQuasar/roberta-prompt_classifier-v0.1
Training data:
DevQuasar/llm_router_dataset-synth
Git:
https://github.com/csabakecskemeti/llm_predictive_router_package

Feel free to check it out, and/or contribute.
Reacted to ImranzamanML's post with πŸ”₯ about 1 month ago
view post
Post
1355
LoRA with code πŸš€ using PEFT (parameter efficient fine-tuning)

LoRA (Low-Rank Adaptation)
LoRA adds low-rank matrices to specific layers and reduce the number of trainable parameters for efficient fine-tuning.

Code:
Please install these libraries first:
pip install peft
pip install datasets
pip install transformers

from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments
from peft import LoraConfig, get_peft_model
from datasets import load_dataset

# Loading the pre-trained BERT model
model = AutoModelForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=2)

# Configuring the LoRA parameters
lora_config = LoraConfig(
    r=8,
    lora_alpha=16, 
    lora_dropout=0.1, 
    bias="none" 
)

# Applying LoRA to the model
model = get_peft_model(model, lora_config)

# Loading dataset for classification
dataset = load_dataset("glue", "sst2")
train_dataset = dataset["train"]

# Setting the training arguments
training_args = TrainingArguments(
    output_dir="./results",
    per_device_train_batch_size=16,
    num_train_epochs=3,
    logging_dir="./logs",
)

# Creating a Trainer instance for fine-tuning
trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_dataset,
)

# Finally we can fine-tune the model
trainer.train()


LoRA adds low-rank matrices to fine-tune only a small portion of the model and reduces training overhead by training fewer parameters.
We can perform efficient fine-tuning with minimal impact on accuracy and its suitable for large models where full-precision training is still feasible.
New activity in facebook/musicgen-small about 1 month ago

How to get best result?

#31 opened about 1 month ago by Sengil

Question

1
#28 opened 8 months ago by Chelik
New activity in facebook/musicgen-large about 1 month ago

how to get best result

#22 opened about 1 month ago by Sengil
New activity in black-forest-labs/FLUX.1-schnell 2 months ago

GPU and memory requirements

2
#89 opened 2 months ago by Sengil
New activity in black-forest-labs/FLUX.1-schnell 2 months ago