Skip to content

Commit

Permalink
docs: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
doomspec committed Aug 29, 2024
1 parent 4fd9e6b commit 2b6bc95
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/parsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,17 @@ chat += "Summarize the following text:<text> This is a test.</text>"
chat += "Start your answer with Summary:"
res = chat.complete(parse="colon")
print(res)
```

## Automated correction

Some good LLMs do not support a JSON mode, such as claude models. They usually output JSON with small semantic errors. We designed an auto-correction rule to fix these errors by inputting these bad JSON into a cheap LLM that supports JSON mode.

You have to turn on this feature by setting `parse_options.correct_json_by_model = True`.

```python
from mllm.config import parse_options
# You have to enable this option before using the `correct_json_by_model` rule
parse_options.correct_json_by_model = True
# parse_options.cheap_model = "gpt-4o-mini" # The default model is gpt-4o-mini
```

0 comments on commit 2b6bc95

Please sign in to comment.