Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
vinid committed Jun 12, 2024
1 parent 581b5e8 commit e4a0d17
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ question = tg.Variable(question_string,
answer = model(question)
```

> :warning: answer: To determine how long it will take to dry 30 shirts under the sun,
> we can use a proportional relationship based on the given information.
> Here’s the step-by-step reasoning: [.....]
> So, it will take 1.2 hours (or 1 hour and 12 minutes) to dry 30 shirts under the sun.
> :warning: answer: To determine how long it will take to dry 30 shirts under the sun,**
> **we can use a proportional relationship based on the given information.**
> **Here’s the step-by-step reasoning: [.....]**
> **So, it will take 1.2 hours (or 1 hour and 12 minutes) to dry 30 shirts under the sun.**

As you can see, **the model's answer is incorrect.** We can optimize the answer using TextGrad to get the correct answer.
Expand All @@ -71,9 +71,9 @@ evaluation_instruction = (f"Here's a question: {question_string}. "
# how we want to evaluate the reasoning.
loss_fn = tg.TextLoss(evaluation_instruction)
```
> :brain: loss: [...] Your step-by-step reasoning is clear and logical,
> but it contains a critical flaw in the assumption that drying time is
> directly proportional to the number of shirts. [...]
> :brain: **loss: [...] Your step-by-step reasoning is clear and logical,**
> **but it contains a critical flaw in the assumption that drying time is**
> **directly proportional to the number of shirts. [...]**
```python
# Step 3: Do the loss computation, backward pass, and update the punchline.
Expand All @@ -84,8 +84,8 @@ optimizer.step()
answer
```

> :white_check_mark: answer: It will still take 1 hour to dry 30 shirts under the sun,
> assuming they are all laid out properly to receive equal sunlight.
> :white_check_mark: **answer: It will still take 1 hour to dry 30 shirts under the sun,**
> **assuming they are all laid out properly to receive equal sunlight.**


Expand Down

0 comments on commit e4a0d17

Please sign in to comment.