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
Copy file name to clipboardExpand all lines: docs/lab-7/README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,8 +60,10 @@ python3.11 -m venv venv
60
60
source venv/bin/activate
61
61
pip install mellea
62
62
```
63
-
Note: If you see something about the Rust compiler, please confirm you are using python3.11, or python3.12
64
-
anything above that has a Rust dependency.
63
+
64
+
!!! note
65
+
If you see something about the Rust compiler, please confirm you are using python3.11, or python3.12 anything above that has a Rust dependency.
66
+
65
67
2. Run a simple Mellea session:
66
68
```python
67
69
import mellea
@@ -74,8 +76,8 @@ you are set up to dig deeper with Mellea.
74
76
75
77
## Simple email examples
76
78
77
-
Note: The following work should be done via a text editor, there should be a couple installed on your
78
-
laptop, if you aren't sure raise your hand and a helper will help you out.
79
+
!!! note
80
+
The following work should be done via a text editor, there should be a couple installed on your laptop, if you aren't sure raise your hand and a helper will help you out.
79
81
80
82
Let's leverage Mellea to do some email generation for us, the first example is a simple example:
Most of this should look familiar by now, but the `validation_fn` and `check` should be new.
228
+
226
229
We create 3 requirements:
230
+
227
231
- First requirement (r1) will be validated by LLM-as-a-judge on the output of the instruction. This is the default behavior.
228
232
- Second requirement (r2) uses a function that takes the output of a sampling step and returns a boolean value indicating successful or unsuccessful validation. While the validation_fn parameter requires to run validation on the full session context, Mellea provides a wrapper for simpler validation functions (simple_validate(fn: Callable[[str], bool])) that take the output string and return a boolean as seen in this case.
229
233
- Third requirement is a check(). Checks are only used for validation, not for generation. Don't think mention purple elephants.
0 commit comments