Skip to content

Commit c25cf81

Browse files
authored
Add phi3.5 config files (#127)
* add phi3.5 config files * small update
1 parent 1dd350e commit c25cf81

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Apache Software License 2.0
2+
#
3+
# Copyright (c) ZenML GmbH 2024. All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
model:
19+
name: llm-peft-phi-3.5-mini-instruct
20+
description: "Fine-tune Phi-3.5-mini-instruct."
21+
tags:
22+
- llm
23+
- peft
24+
- phi-3.5
25+
version: 300_steps
26+
27+
settings:
28+
docker:
29+
parent_image: pytorch/pytorch:2.2.2-cuda11.8-cudnn8-runtime
30+
requirements: requirements.txt
31+
python_package_installer: uv
32+
python_package_installer_args:
33+
system: null
34+
apt_packages:
35+
- git
36+
environment:
37+
PJRT_DEVICE: CUDA
38+
USE_TORCH_XLA: "false"
39+
MKL_SERVICE_FORCE_INTEL: "1"
40+
41+
parameters:
42+
# uses a 4-bit quantised version of Phi 3.5 for local experimentation
43+
base_model_id: microsoft/Phi-3.5-mini-instruct
44+
use_fast: False
45+
load_in_4bit: True
46+
system_prompt: |
47+
Given a target sentence construct the underlying meaning representation of the input sentence as a single function with attributes and attribute values.
48+
This function should describe the target string accurately and the function must be one of the following ['inform', 'request', 'give_opinion', 'confirm', 'verify_attribute', 'suggest', 'request_explanation', 'recommend', 'request_attribute'].
49+
The attributes must be one of the following: ['name', 'exp_release_date', 'release_year', 'developer', 'esrb', 'rating', 'genres', 'player_perspective', 'has_multiplayer', 'platforms', 'available_on_steam', 'has_linux_release', 'has_mac_release', 'specifier']
50+
51+
52+
steps:
53+
prepare_data:
54+
parameters:
55+
dataset_name: gem/viggo
56+
57+
finetune:
58+
parameters:
59+
max_steps: 300
60+
eval_steps: 30
61+
bf16: True
62+
63+
promote:
64+
parameters:
65+
metric: rouge2
66+
target_stage: staging
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Apache Software License 2.0
2+
#
3+
# Copyright (c) ZenML GmbH 2024. All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
model:
19+
name: llm-peft-phi-3.5-mini-instruct
20+
description: "Fine-tune Phi-3.5-mini-instruct."
21+
tags:
22+
- llm
23+
- peft
24+
- phi-3.5
25+
version: 300_steps
26+
27+
settings:
28+
docker:
29+
parent_image: pytorch/pytorch:2.2.2-cuda11.8-cudnn8-runtime
30+
requirements: requirements.txt
31+
python_package_installer: uv
32+
python_package_installer_args:
33+
system: null
34+
apt_packages:
35+
- git
36+
environment:
37+
PJRT_DEVICE: CUDA
38+
USE_TORCH_XLA: "false"
39+
MKL_SERVICE_FORCE_INTEL: "1"
40+
41+
parameters:
42+
base_model_id: microsoft/Phi-3.5-mini-instruct
43+
use_fast: False
44+
load_in_4bit: True
45+
system_prompt: |
46+
Given a target sentence construct the underlying meaning representation of the input sentence as a single function with attributes and attribute values.
47+
This function should describe the target string accurately and the function must be one of the following ['inform', 'request', 'give_opinion', 'confirm', 'verify_attribute', 'suggest', 'request_explanation', 'recommend', 'request_attribute'].
48+
The attributes must be one of the following: ['name', 'exp_release_date', 'release_year', 'developer', 'esrb', 'rating', 'genres', 'player_perspective', 'has_multiplayer', 'platforms', 'available_on_steam', 'has_linux_release', 'has_mac_release', 'specifier']
49+
50+
51+
steps:
52+
prepare_data:
53+
parameters:
54+
dataset_name: gem/viggo
55+
56+
finetune:
57+
step_operator: gcp_a100
58+
retry:
59+
max_retries: 3
60+
delay: 10
61+
backoff: 2
62+
parameters:
63+
max_steps: 300
64+
eval_steps: 30
65+
bf16: True
66+
67+
evaluate_finetuned:
68+
step_operator: gcp_a100
69+
retry:
70+
max_retries: 3
71+
delay: 10
72+
backoff: 2
73+
74+
evaluate_base:
75+
step_operator: gcp_a100
76+
retry:
77+
max_retries: 3
78+
delay: 10
79+
backoff: 2
80+
81+
promote:
82+
parameters:
83+
metric: rouge2
84+
target_stage: staging

0 commit comments

Comments
 (0)