-
Notifications
You must be signed in to change notification settings - Fork 322
add Actions workflow to push model to Replicate #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1007c14
add workflow to publish releases on Replicate
zeke 9dc9c93
free disk space
zeke 54c7252
user new python action
zeke 63fdae2
Merge branch 'replicate:main' into main
zeke e27b259
use workflow dispatch to trigger workflow
zeke 0ee4ce0
use cog to download weights
zeke d5615f1
install NVIDIA stuff from replicate/codespaces
zeke f8550a1
set up docker builds
zeke 065bd13
print cog and docker version info
zeke 6236f84
don't free disk space because somehow that's suddenly breaking
zeke 092661f
install prerelease of cog
zeke 20624f6
use install script, then override cog version with pre-release
zeke fa88e44
free disk space
zeke 63bbb6a
free up less
zeke c274178
rename stuff
zeke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Push model to Replicate | ||
|
|
||
| # This workflow is triggered manually from the GitHub website. | ||
| # To run it, click the "Actions" tab on the repo page. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| model_name: | ||
| required: true | ||
| description: The name of the Replicate model to publish, in the format `username-or-org/modelname`. | ||
|
|
||
| jobs: | ||
| push: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Free disk space | ||
| uses: jlumbroso/free-disk-space@main | ||
| with: | ||
| large-packages: false | ||
| tool-cache: false | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
|
|
||
| - name: Install Cog and NVIDIA drivers | ||
| run: | | ||
| curl https://replicate.github.io/codespaces/scripts/install-cog.sh | bash | ||
|
|
||
| # This version of Cog adds support `cog run` on non-GPU environments like GitHub Actions' default runners | ||
| - name: Install Cog v0.8.0-beta3 | ||
| run: | | ||
| sudo curl -o /usr/local/bin/cog -L https://github.com/replicate/cog/releases/download/v0.8.0-beta3/cog_Linux_x86_64 | ||
| sudo chmod +x /usr/local/bin/cog | ||
|
|
||
| - name: Print Docker and Cog version info | ||
| run: | | ||
| docker version | ||
| cog --version | ||
|
|
||
| - name: Download model weights from HuggingFace | ||
| run: | | ||
| cog run script/download-weights | ||
|
|
||
| - name: Log in to Replicate | ||
| env: | ||
| REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }} | ||
| run: | | ||
| echo $REPLICATE_API_TOKEN | cog login --token-stdin | ||
|
|
||
| - name: Push to Replicate | ||
| run: | | ||
| cog push r8.im/${{ inputs.model_name }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| diffusers==0.11.1 | ||
| torch==1.13.0 | ||
| ftfy==6.1.1 | ||
| scipy==1.9.3 | ||
| transformers==4.25.1 | ||
| accelerate==0.15.0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
python_requirementsis a thing now? See replicate/cog#714Using it here so I can manually
pip install -r requirements.txtin the Actions workflow.