-
Notifications
You must be signed in to change notification settings - Fork 49
78 lines (69 loc) · 2.78 KB
/
push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Push
on:
workflow_dispatch:
branches: [main]
inputs:
test_only:
description: 'Test only, without pushing to prod'
type: boolean
default: true
compare_outputs:
description: 'Compare hotswap prediction outputs between existing version and new version'
type: boolean
default: true
compare_trainer_outputs:
description: 'Compare training outputs between existing version and new version'
type: boolean
default: true
jobs:
cog-safe-push:
runs-on: ubuntu-latest-4-cores
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Cog
run: |
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/local/bin/cog
- name: cog login
run: |
echo ${{ secrets.COG_TOKEN }} | cog login --token-stdin
- name: Install cog-safe-push
run: |
pip install git+https://github.com/replicate/cog-safe-push.git
- name: Run cog-safe-push to test the trainer
if: ${{ github.event.inputs.compare_trainer_outputs = 'true' }}
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
run: |
cog-safe-push -vv \
--test-model=replicate-internal/test-flux-fine-tuner \
--test-only \
--train \
--train-destination=replicate-internal/test-flux-fine-tuner-dest \
--predict-timeout=480 \
-i input_images=https://github.com/andreasjansson/sprites-dataset/raw/main/sprites.zip \
-i steps=100 \
ostris/flux-dev-lora-trainer
- name: Run cog-safe-push to test the predictor and optionally push to production
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
run: |
cog-safe-push -vv \
--test-model=replicate-internal/test-flux-fine-tuner \
${{ github.event.inputs.test_only == 'true' && '--test-only' || '' }} \
${{ github.event.inputs.compare_outputs == 'false' && '--no-compare-outputs' || '' }} \
-i replicate_weights="https://replicate.delivery/yhqm/iWjMZHd2T35kI5jaUkaG3Jb43MeA67PpYjKZQeifvTEf9yTNB/trained_model.tar" \
-i extra_lora="(omit)^50%" \
-i extra_lora="fofr/flux-pixar-cars" \
-i extra_lora="huggingface.co/fofr/flux-wrong" \
-i extra_lora="https://civitai.com/api/download/models/731747?type=Model&format=SafeTensor" \
--predict-timeout=600 \
ostris/flux-dev-lora-trainer