Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/dockerfile/standard_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,7 @@ func (g *StandardGenerator) installCog() (string, error) {
}
pipInstallLine := "RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir"
pipInstallLine += " " + containerPath
// Install pydantic<2 for now, installing pydantic>2 wouldn't allow a downgrade later,
// but upgrading works fine
pipInstallLine += " 'pydantic<2'"
pipInstallLine += " 'pydantic>=1.9,<3'"
if g.strip {
pipInstallLine += " && " + StripDebugSymbolsCommand
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dockerfile/standard_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func testInstallCog(relativeTmpDir string, stripped bool) string {
}
return fmt.Sprintf(`COPY %s/%s /tmp/%s
ENV CFLAGS="-O3 -funroll-loops -fno-strict-aliasing -flto -S"
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir /tmp/%s 'pydantic<2'%s
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir /tmp/%s 'pydantic>=1.9,<3'%s
ENV CFLAGS=`, relativeTmpDir, wheel, wheel, wheel, strippedCall)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Configuration for Cog ⚙️
# Reference: https://cog.run/yaml

# image name:version
image: "r8.im/ibm-granite/granite-3.3-8b-instruct:1.0.0"

build:
# python version in the form '3.11' or '3.11.4'
python_version: "3.11"

# path to a Python requirements.txt file
python_requirements: requirements.txt

# predict.py defines how predictions are run on your model
predict: "predict.py:Predictor"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from cog import BasePredictor

import pydantic


class Predictor(BasePredictor):
def predict(self) -> str:
return pydantic.__version__
Loading
Loading