mirror of
https://github.com/transformerlab/transformerlab-api.git
synced 2025-04-19 19:36:18 +03:00
Upgrade transformers version and handle device assignment in llama trainer
This commit is contained in:
@@ -132,7 +132,7 @@ httpcore==1.0.7
|
||||
# via httpx
|
||||
httpx==0.28.1
|
||||
# via fschat
|
||||
huggingface-hub==0.28.0
|
||||
huggingface-hub==0.30.2
|
||||
# via
|
||||
# accelerate
|
||||
# datasets
|
||||
@@ -450,7 +450,7 @@ tqdm==4.66.5
|
||||
# peft
|
||||
# sentence-transformers
|
||||
# transformers
|
||||
transformers==4.50.0
|
||||
transformers==4.51.0
|
||||
# via
|
||||
# -r requirements.in
|
||||
# peft
|
||||
|
||||
@@ -132,7 +132,7 @@ httpcore==1.0.7
|
||||
# via httpx
|
||||
httpx==0.28.1
|
||||
# via fschat
|
||||
huggingface-hub==0.28.0
|
||||
huggingface-hub==0.30.2
|
||||
# via
|
||||
# accelerate
|
||||
# datasets
|
||||
@@ -482,7 +482,7 @@ tqdm==4.67.1
|
||||
# peft
|
||||
# sentence-transformers
|
||||
# transformers
|
||||
transformers==4.50.0
|
||||
transformers==4.51.0
|
||||
# via
|
||||
# -r requirements.in
|
||||
# peft
|
||||
|
||||
@@ -21,7 +21,7 @@ tiktoken
|
||||
torch==2.6.0
|
||||
torchaudio==2.6.0
|
||||
torchvision==0.21.0
|
||||
transformers==4.50.0
|
||||
transformers==4.51.0
|
||||
peft
|
||||
watchfiles
|
||||
wandb==0.19.8
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "A training script adapted from https://www.philschmid.de/instruction-tune-llama-2 for training Llama2 using PeFT",
|
||||
"plugin-format": "python",
|
||||
"type": "trainer",
|
||||
"version": "1.0.18",
|
||||
"version": "1.0.19",
|
||||
"model_architectures": ["LlamaForCausalLM", "Qwen2ForCausalLM"],
|
||||
"git": "",
|
||||
"url": "",
|
||||
|
||||
@@ -3,6 +3,9 @@ import os
|
||||
from random import randrange
|
||||
|
||||
import torch
|
||||
if torch.cuda.is_available():
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
||||
|
||||
from jinja2 import Environment
|
||||
from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training, PeftModel
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, AutoConfig
|
||||
@@ -16,9 +19,6 @@ use_flash_attention = False
|
||||
# Initialize Jinja environment
|
||||
jinja_environment = Environment()
|
||||
|
||||
if torch.cuda.is_available():
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
||||
|
||||
|
||||
@tlab_trainer.job_wrapper()
|
||||
def train_model():
|
||||
|
||||
Reference in New Issue
Block a user