Skip to content

Commit

Permalink
updated all Dataset output examples to use python syntax highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
djl11 committed Sep 19, 2024
1 parent a9ffc4a commit 265d11c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions benchmarking/datasets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ datum = unify.Datum(
ref_answer="This is an answer."
)
```
```
```python
Datum(
prompt=Prompt(
messages=[{'content': 'This is a user message.', 'role': 'user'}]
Expand All @@ -112,7 +112,7 @@ When a list of strings is passed, these strings are also interpreted as *user me
but as explained above, the underlying dataset will contains `Datum` instances,
which themselves contain `Prompt` instances:

```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -153,7 +153,7 @@ dataset = unify.Dataset([
),
])
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -208,7 +208,7 @@ dataset = unify.Dataset([
),
])
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -243,7 +243,7 @@ interpreted as single-item datasets:
import unify
dataset = unify.Dataset("First user message.")
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -296,7 +296,7 @@ dataset = unify.Dataset([
])
print(dataset[1:-1])
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -344,7 +344,7 @@ dataset2 = unify.Dataset([
])
print(dataset1 + dataset2)
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -385,7 +385,7 @@ dataset2 = unify.Dataset([
])
print(dataset1 + dataset2)
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -434,7 +434,7 @@ dataset += "Second user message."
dataset += unify.Prompt(messages=[{'content': 'Third user message.', 'role': 'user'}])
dataset += ["Fourth user message.", "Fifth user message."]
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -473,7 +473,7 @@ The ordering of the operation also does not matter, by virtue of `__radd__` and
import unify
"User message" + unify.Dataset("Another user message.")
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -502,7 +502,7 @@ dataset = "First user message." \
+ unify.Datum("Third user message")
print(dataset)
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -542,7 +542,7 @@ dataset2 = unify.Dataset([
])
print(dataset1 - dataset2)
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -592,7 +592,7 @@ dataset -= "First user message"
dataset = dataset - unify.Prompt("Second user message.")
print(dataset)
```
```
```python
Dataset(
[
Datum(
Expand Down Expand Up @@ -697,7 +697,7 @@ You can directly download a dataset from your account as follows:
import unify
dataset = unify.Dataset.from_upstream("my_dataset")
```
```
```python
Dataset(
[
Datum(
Expand Down

0 comments on commit 265d11c

Please sign in to comment.