Skip to content

Commit fdf9c1b

Browse files
non-rc version bump (#248)
1 parent 32a0b9e commit fdf9c1b

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

docs/CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
Release notes for new versions of Truss, in reverse chronological order.
44

5+
### Version 0.4.0
6+
7+
This release updates the model invocation interface in Truss templates, affecting **only newly created Trusses**.
8+
9+
Until now, when creating a Truss, the `predict()` function expected a dictionary with the key `inputs` and a value to give the model as input. This default behavior was due to a legacy requirement in Baseten that was removed months ago.
10+
11+
Now, the default behavior is to use the input of `predict()` directly, which can be anything JSON-serializable: string, number, list, dictionary, etc. If you want, you can modify the `predict()` function to expect a dictionary with `inputs` like the old spec.
12+
13+
Before (sklearn iris):
14+
15+
```python
16+
model.predict({"inputs": [[0, 0, 0, 0]]})
17+
```
18+
19+
Now (sklearn iris):
20+
21+
```python
22+
model.predict([[0, 0, 0, 0]])
23+
```
24+
25+
**This change does not affect existing Trusses.** Only new Trusses created on this version (i.e. by running `truss.create()` or `truss init`) will use the updated templates.
26+
27+
### Version 0.3.0
28+
29+
This version was created to support [blueprint](https://blueprint.baseten.co).
30+
531
### Version 0.2.0
632

733
With this release, a minor version increment recognizes the overall progress made on Truss since its initial release in Summer 2022. And simplified naming for key functions improves Truss' developer experience, while carefully considered warnings and a long deprecation period ensure nothing breaks.

docs/develop/processing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Here is a post-processing function from the same [TensorFlow example](../create/
4141
```python
4242
from scipy.special import softmax
4343

44-
def postprocess(self, model_output: Dict, k=5) -> Dict:
44+
def postprocess(self, model_output: Any, k=5) -> Any:
4545
"""Post process step for ResNet"""
4646
class_predictions = model_output["predictions"][0]
4747
LABELS = requests.get(

docs/notebooks/tensorflow_example.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"Finally, update the post-processing function to:\n",
9494
"\n",
9595
"```python\n",
96-
"def postprocess(self, model_output: Dict, k=5) -> Dict:\n",
96+
"def postprocess(self, model_output: Any, k=5) -> Any:\n",
9797
" \"\"\"Post process step for ResNet\"\"\"\n",
9898
" class_predictions = model_output[\"predictions\"][0]\n",
9999
" LABELS = requests.get(\n",

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "truss"
3-
version = "0.4.0rc1"
3+
version = "0.4.0"
44
description = "A seamless bridge from model development to model delivery"
55
license = "MIT"
66
readme = "README.md"

0 commit comments

Comments
 (0)