Skip to content

Commit

Permalink
changed import relations.
Browse files Browse the repository at this point in the history
Signed-off-by: Xinyu Ye <[email protected]>
  • Loading branch information
XinyuYe-Intel committed Aug 19, 2024
1 parent 11ee6fb commit 21b0b02
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions comps/finetuning/finetune_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pydantic_yaml import parse_yaml_raw_as
from transformers import TrainerCallback, TrainerControl, TrainerState, TrainingArguments

from .llm_on_ray.finetune.finetune_config import FinetuneConfig
from comps.finetuning.llm_on_ray.finetune.finetune_config import FinetuneConfig


class FineTuneCallback(TrainerCallback):
Expand All @@ -29,7 +29,7 @@ def main():
callback = FineTuneCallback()
finetune_config["Training"]["callbacks"] = [callback]

from .llm_on_ray.finetune.finetune import main as llm_on_ray_finetune_main
from comps.finetuning.llm_on_ray.finetune.finetune import main as llm_on_ray_finetune_main

llm_on_ray_finetune_main(finetune_config)

Expand Down
4 changes: 2 additions & 2 deletions comps/finetuning/finetuning_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import uvicorn
from fastapi import BackgroundTasks, FastAPI
from handlers import (
from comps.finetuning.handlers import (
handle_cancel_finetuning_job,
handle_create_finetuning_jobs,
handle_list_finetuning_jobs,
handle_retrieve_finetuning_job,
)

from .models import FineTuningJob, FineTuningJobList, FineTuningJobsRequest
from comps.finetuning.models import FineTuningJob, FineTuningJobList, FineTuningJobsRequest

app = FastAPI()

Expand Down
7 changes: 2 additions & 5 deletions comps/finetuning/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
from fastapi import BackgroundTasks, HTTPException
from pydantic_yaml import parse_yaml_raw_as, to_yaml_file
from ray.job_submission import JobSubmissionClient
from ray.train.base_trainer import TrainingFailedError
from ray.tune.logger import LoggerCallback

from .llm_on_ray.finetune.finetune import main
from .llm_on_ray.finetune.finetune_config import FinetuneConfig
from .models import FineTuningJob, FineTuningJobEvent, FineTuningJobList, FineTuningJobsRequest
from comps.finetuning.llm_on_ray.finetune.finetune_config import FinetuneConfig
from comps.finetuning.models import FineTuningJob, FineTuningJobList, FineTuningJobsRequest

MODEL_CONFIG_FILE_MAP = {
"meta-llama/Llama-2-7b-chat-hf": "./models/llama-2-7b-chat-hf.yaml",
Expand Down
6 changes: 3 additions & 3 deletions comps/finetuning/llm_on_ray/finetune/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from ray.air.config import ScalingConfig
from ray.train.torch import TorchTrainer

from ...llm_on_ray import common
from .data_process import DataProcessor
from .finetune_config import FinetuneConfig
from comps.finetuning.llm_on_ray import common
from comps.finetuning.llm_on_ray.finetune.data_process import DataProcessor
from comps.finetuning.llm_on_ray.finetune.finetune_config import FinetuneConfig


def adapt_transformers_to_device(config: Dict):
Expand Down
10 changes: 10 additions & 0 deletions comps/finetuning/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
aiohttp
datasets
docarray
fastapi
httpx
opentelemetry-api
opentelemetry-exporter-otlp
opentelemetry-sdk
peft
prometheus-fastapi-instrumentator
pydantic
pydantic_yaml
pyyaml
ray[all]
requests
shortuuid
transformers
uvicorn

0 comments on commit 21b0b02

Please sign in to comment.