Skip to content

Commit d66ba58

Browse files
committed
update readme and add config file
1 parent dac219d commit d66ba58

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

gamesense/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ GameSense leverages Parameter-Efficient Fine-Tuning (PEFT) techniques to customi
4646
- Python 3.8+
4747
- GPU with at least 24GB VRAM (for full model training)
4848
- ZenML installed and configured
49+
- Neptune.ai account for experiment tracking
50+
51+
### Environment Setup
52+
53+
1. Set up your Neptune.ai credentials:
54+
```bash
55+
# Set your Neptune project name and API token as environment variables
56+
export NEPTUNE_PROJECT="your-neptune-workspace/your-project-name"
57+
export NEPTUNE_API_TOKEN="your-neptune-api-token"
58+
```
4959

5060
### Quick Setup
5161

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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-cpu
20+
description: "Fine-tune Phi-3.5-mini-instruct on CPU."
21+
tags:
22+
- llm
23+
- peft
24+
- phi-3.5
25+
- cpu
26+
version: 100_steps
27+
28+
settings:
29+
docker:
30+
parent_image: pytorch/pytorch:2.2.2-runtime
31+
requirements: requirements.txt
32+
python_package_installer: uv
33+
python_package_installer_args:
34+
system: null
35+
apt_packages:
36+
- git
37+
environment:
38+
MKL_SERVICE_FORCE_INTEL: "1"
39+
# Explicitly disable MPS
40+
PYTORCH_ENABLE_MPS_FALLBACK: "0"
41+
PYTORCH_MPS_HIGH_WATERMARK_RATIO: "0.0"
42+
43+
parameters:
44+
# Uses a smaller model for CPU training
45+
base_model_id: microsoft/Phi-3.5-mini-instruct
46+
use_fast: False
47+
load_in_4bit: False
48+
load_in_8bit: False
49+
cpu_only: True # Enable CPU-only mode
50+
# Extra conservative dataset size for CPU
51+
max_train_samples: 50
52+
max_val_samples: 10
53+
max_test_samples: 5
54+
system_prompt: |
55+
Given a target sentence construct the underlying meaning representation of the input sentence as a single function with attributes and attribute values.
56+
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'].
57+
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']
58+
59+
60+
steps:
61+
prepare_data:
62+
parameters:
63+
dataset_name: gem/viggo
64+
# These settings are now defined at the pipeline level
65+
# max_train_samples: 100
66+
# max_val_samples: 20
67+
# max_test_samples: 10
68+
69+
finetune:
70+
parameters:
71+
max_steps: 25 # Further reduced steps for CPU training
72+
eval_steps: 5 # More frequent evaluation
73+
bf16: False # Disable bf16 for CPU compatibility
74+
per_device_train_batch_size: 1 # Smallest batch size for CPU
75+
gradient_accumulation_steps: 2 # Reduced for CPU
76+
optimizer: "adamw_torch" # Use standard AdamW rather than 8-bit for CPU
77+
logging_steps: 2 # More frequent logging
78+
save_steps: 25 # Save less frequently
79+
save_total_limit: 1 # Keep only the best model
80+
evaluation_strategy: "steps"
81+
82+
promote:
83+
parameters:
84+
metric: rouge2
85+
target_stage: staging

0 commit comments

Comments
 (0)