Skip to content

Commit

Permalink
fix some more docs typos (#1370)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 authored Mar 26, 2024
1 parent 8d5f208 commit 4527969
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/docs/guides/tracking/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ weave.init('intro-example')
sentence = "There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy."

# highlight-next-line
with weave.attributes({'user_id', 'lukas', 'env': 'production'}):
with weave.attributes({'user_id': 'lukas', 'env': 'production'}):
extract_fruit(sentence)
```
11 changes: 7 additions & 4 deletions docs/docs/tutorial-eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ExtractFruitsModel(weave.Model):
],
)
result = response.choices[0].message.content
if result is None:
raise ValueError("No response from model")
if result is None:
raise ValueError("No response from model")
parsed = json.loads(result)
return parsed
```
Expand All @@ -56,7 +56,8 @@ model = ExtractFruitsModel(model_name='gpt-3.5-turbo-1106',
prompt_template='Extract fields ("fruit": <str>, "color": <str>, "flavor": <str>) from the following text, as json: {sentence}')
sentence = "There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy."
print(asyncio.run(model.predict(sentence)))
# note: you can also call `await model.predict(sentence)` within async functions
# if you're in a Jupyter Notebook, run:
# await model.predict(sentence)
```

:::note
Expand Down Expand Up @@ -101,11 +102,13 @@ def fruit_name_score(target: dict, prediction: dict) -> dict:
# highlight-next-line
evaluation = weave.Evaluation(
# highlight-next-line
dataset=dataset, scorers=[MulticlassF1Score(class_names=["fruit", "color", "flavor"]), fruit_name_score],
dataset=examples, scorers=[MulticlassF1Score(class_names=["fruit", "color", "flavor"]), fruit_name_score],
# highlight-next-line
)
# highlight-next-line
print(asyncio.run(evaluation.evaluate(model)))
# if you're in a Jupyter Notebook, run:
# await evaluation.evaluate(model)
```

## Pulling it all together
Expand Down

0 comments on commit 4527969

Please sign in to comment.