mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
pre-commit
This commit is contained in:
parent
dadb257f03
commit
562d5228de
2 changed files with 21 additions and 20 deletions
|
@ -16,8 +16,6 @@ from typing import Any, Callable, Dict, List
|
||||||
import torch
|
import torch
|
||||||
from llama_models.datatypes import Model
|
from llama_models.datatypes import Model
|
||||||
from llama_models.sku_list import resolve_model
|
from llama_models.sku_list import resolve_model
|
||||||
from llama_stack.apis.common.type_system import ParamType, StringType
|
|
||||||
from llama_stack.apis.datasets import Datasets
|
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
@ -25,6 +23,9 @@ from torchtune.models.llama3 import llama3_tokenizer, lora_llama3_8b
|
||||||
from torchtune.models.llama3._tokenizer import Llama3Tokenizer
|
from torchtune.models.llama3._tokenizer import Llama3Tokenizer
|
||||||
from torchtune.models.llama3_2 import lora_llama3_2_3b
|
from torchtune.models.llama3_2 import lora_llama3_2_3b
|
||||||
|
|
||||||
|
from llama_stack.apis.common.type_system import ParamType, StringType
|
||||||
|
from llama_stack.apis.datasets import Datasets
|
||||||
|
|
||||||
|
|
||||||
class ColumnName(Enum):
|
class ColumnName(Enum):
|
||||||
instruction = "instruction"
|
instruction = "instruction"
|
||||||
|
|
|
@ -14,6 +14,24 @@ from typing import Any, Dict, List, Optional, Tuple
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from llama_models.sku_list import resolve_model
|
from llama_models.sku_list import resolve_model
|
||||||
|
from torch import nn
|
||||||
|
from torch.optim import Optimizer
|
||||||
|
from torch.utils.data import DataLoader, DistributedSampler
|
||||||
|
from torchtune import modules, training, utils as torchtune_utils
|
||||||
|
from torchtune.data import AlpacaToMessages, padded_collate_sft
|
||||||
|
|
||||||
|
from torchtune.modules.loss import CEWithChunkedOutputLoss
|
||||||
|
from torchtune.modules.peft import (
|
||||||
|
get_adapter_params,
|
||||||
|
get_adapter_state_dict,
|
||||||
|
get_lora_module_names,
|
||||||
|
get_merged_lora_ckpt,
|
||||||
|
set_trainable_params,
|
||||||
|
validate_missing_and_unexpected_for_lora,
|
||||||
|
)
|
||||||
|
from torchtune.training.lr_schedulers import get_cosine_schedule_with_warmup
|
||||||
|
from torchtune.training.metric_logging import DiskLogger
|
||||||
|
from tqdm import tqdm
|
||||||
|
|
||||||
from llama_stack.apis.common.training_types import PostTrainingMetric
|
from llama_stack.apis.common.training_types import PostTrainingMetric
|
||||||
from llama_stack.apis.datasetio import DatasetIO
|
from llama_stack.apis.datasetio import DatasetIO
|
||||||
|
@ -38,24 +56,6 @@ from llama_stack.providers.inline.post_training.torchtune.config import (
|
||||||
TorchtunePostTrainingConfig,
|
TorchtunePostTrainingConfig,
|
||||||
)
|
)
|
||||||
from llama_stack.providers.inline.post_training.torchtune.datasets.sft import SFTDataset
|
from llama_stack.providers.inline.post_training.torchtune.datasets.sft import SFTDataset
|
||||||
from torch import nn
|
|
||||||
from torch.optim import Optimizer
|
|
||||||
from torch.utils.data import DataLoader, DistributedSampler
|
|
||||||
from torchtune import modules, training, utils as torchtune_utils
|
|
||||||
from torchtune.data import AlpacaToMessages, padded_collate_sft
|
|
||||||
|
|
||||||
from torchtune.modules.loss import CEWithChunkedOutputLoss
|
|
||||||
from torchtune.modules.peft import (
|
|
||||||
get_adapter_params,
|
|
||||||
get_adapter_state_dict,
|
|
||||||
get_lora_module_names,
|
|
||||||
get_merged_lora_ckpt,
|
|
||||||
set_trainable_params,
|
|
||||||
validate_missing_and_unexpected_for_lora,
|
|
||||||
)
|
|
||||||
from torchtune.training.lr_schedulers import get_cosine_schedule_with_warmup
|
|
||||||
from torchtune.training.metric_logging import DiskLogger
|
|
||||||
from tqdm import tqdm
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue