Skip to content

Commit

Permalink
update finetuning doc (#615)
Browse files Browse the repository at this point in the history
* revert code because of overwriting by other pr.

* update finetuning doc.

---------

Co-authored-by: root <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 5, 2024
1 parent f4d123c commit 7d2cd6b
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 79 deletions.
10 changes: 4 additions & 6 deletions comps/finetuning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ Assuming a training file `alpaca_data.json` is uploaded, it can be downloaded in

```bash
# upload a training file

curl http://${your_ip}:8015/v1/files -X POST -H "Content-Type: multipart/form-data" -F "file=@./alpaca_data.json" -F purpose="fine-tune"

# create a finetuning job
curl http://${your_ip}:8015/v1/fine_tuning/jobs \

-X POST \
-H "Content-Type: application/json" \
-d '{
Expand All @@ -106,17 +104,13 @@ curl http://${your_ip}:8015/v1/fine_tuning/jobs \
}'

# list finetuning jobs

curl http://${your_ip}:8015/v1/fine_tuning/jobs -X GET

# retrieve one finetuning job
curl http://localhost:8015/v1/fine_tuning/jobs/retrieve -X POST -H "Content-Type: application/json" -d '{
"fine_tuning_job_id": ${fine_tuning_job_id}}'

# cancel one finetuning job


curl http://localhost:8015/v1/fine_tuning/jobs/cancel -X POST -H "Content-Type: application/json" -d '{
"fine_tuning_job_id": ${fine_tuning_job_id}}'

Expand All @@ -125,3 +119,7 @@ curl http://${your_ip}:8015/v1/finetune/list_checkpoints -X POST -H "Content-Typ


```

# 🚀4. Descriptions for Finetuning parameters

We utilize [OpenAI finetuning parameters](https://platform.openai.com/docs/api-reference/fine-tuning) and extend it with more customizable parameters.
Empty file removed comps/finetuning/datasets/.gitkeep
Empty file.
5 changes: 0 additions & 5 deletions comps/finetuning/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def update_job_status(job_id: FineTuningJobID):
status = str(job_status).lower()
# Ray status "stopped" is OpenAI status "cancelled"
status = "cancelled" if status == "stopped" else status

logger.info(f"Status of job {job_id} is '{status}'")

running_finetuning_jobs[job_id].status = status
if status == "finished" or status == "cancelled" or status == "failed":
break
Expand Down Expand Up @@ -102,7 +100,6 @@ def handle_create_finetuning_jobs(request: FineTuningParams, background_tasks: B
)
finetune_config.General.output_dir = os.path.join(OUTPUT_DIR, job.id)
if os.getenv("DEVICE", ""):

logger.info(f"specific device: {os.getenv('DEVICE')}")

finetune_config.Training.device = os.getenv("DEVICE")
Expand Down Expand Up @@ -176,9 +173,7 @@ async def save_content_to_local_disk(save_path: str, content):
content = await content.read()
fout.write(content)
except Exception as e:

logger.info(f"Write file failed. Exception: {e}")

raise Exception(status_code=500, detail=f"Write file {save_path} failed. Exception: {e}")


Expand Down
Empty file removed comps/finetuning/jobs/.gitkeep
Empty file.
12 changes: 0 additions & 12 deletions comps/finetuning/lanuch.sh

This file was deleted.

56 changes: 0 additions & 56 deletions comps/finetuning/llm_on_ray/common/logging.py

This file was deleted.

0 comments on commit 7d2cd6b

Please sign in to comment.