You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* the actual change
* oops rm extra files
* create docs
* fix up all tests for new approach
* update select examples to demonstrate input-free approach
* tests and pre/post processing
* rm any
Copy file name to clipboardexpand all lines: docs/create/huggingface.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ If you're using a Jupyter notebook, add a line to install the `transformers` and
13
13
{% hint style="warning" %}
14
14
Truss officially supports `transformers` version 4.21.0 or higher. Especially if you're using an online notebook environment like Google Colab or a bundle of packages like Anaconda, ensure that the version you are using is supported. If it's not, use the `--upgrade` flag and pip will install the most recent version.
15
15
{% endhint %}
16
+
16
17
### Create an in-memory model
17
18
18
19
This is the part you want to replace with your own code. Using a Hugging Face transformer, build a machine learning model and keep it in-memory. In this example we're using [bert-base-uncased](https://huggingface.co/bert-base-uncased), which will fill in the missing word in a sentence.
@@ -44,7 +45,7 @@ Check the target directory to see your new Truss!
44
45
To get a prediction from the Truss, try running:
45
46
46
47
```python
47
-
tr.predict({"inputs": ["Donatello is a teenage mutant [MASK] turtle"]})
48
+
tr.predict("Donatello is a teenage mutant [MASK] turtle")
48
49
```
49
50
50
51
For more on running the Truss locally, see [local development](../develop/localhost.md).
You can also specify examples for the model and run them instead. It's much easier to express request data in the example file. Running the example provides for a good dev loop.
0 commit comments