Skip to content

Commit d0323ff

Browse files
committed
Add RC example for MLE team testing
1 parent 5ed0cee commit d0323ff

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

examples/rc/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Cog 0.17.0-rc.2
2+
3+
## Prerelease CLI
4+
5+
```bash
6+
# macOS ARM
7+
sudo curl -o /usr/local/bin/cog -L \
8+
https://github.com/replicate/cog/releases/download/v0.17.0-rc.2/cog_Darwin_arm64
9+
sudo chmod +x /usr/local/bin/cog
10+
sudo xattr -d com.apple.quarantine /usr/local/bin/cog
11+
```
12+
13+
## Prerelease SDK
14+
15+
Pin `sdk_version` in your `cog.yaml` to use the RC SDK and coglet inside the container:
16+
17+
```yaml
18+
build:
19+
python_version: "3.14"
20+
python_requirements: requirements.txt
21+
sdk_version: "0.17.0rc2"
22+
predict: "predict.py:Predictor"
23+
```
24+
25+
Without `sdk_version`, the CLI installs whatever SDK version it was built with.
26+
The RC coglet (Rust HTTP server) is pulled automatically as a dependency of the SDK.
27+
28+
## Try it
29+
30+
```bash
31+
cd examples/rc
32+
cog predict -i text=hello
33+
# => HELLO
34+
```
35+
36+
Add `--debug` to see the coglet boot logs with version info.

examples/rc/cog.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build:
2+
python_version: "3.14"
3+
python_requirements: requirements.txt
4+
5+
# Pin to the 0.17.0 RC SDK. Remove this line to use the default
6+
# SDK version bundled with your cog CLI.
7+
sdk_version: "0.17.0rc2"
8+
9+
predict: "predict.py:Predictor"

examples/rc/predict.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from cog import BasePredictor, Input
2+
3+
4+
class Predictor(BasePredictor):
5+
def setup(self) -> None:
6+
pass
7+
8+
def predict(self, text: str = Input(description="Input text")) -> str:
9+
return text.upper()

examples/rc/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add your model dependencies here, e.g.:
2+
# torch==2.6.0
3+
# transformers

0 commit comments

Comments
 (0)