Skip to content

Commit

Permalink
shorter example
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyg committed Jun 12, 2024
1 parent ab946f3 commit 01ed6f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This API is similar to the Pytorch API, making it simple to adapt to your usecas

## QuickStart
If you know PyTorch, you know 80% of TextGrad.
Let's walk through the key components with a simple example. Say we want to use GPT-4o to generate a punchline for TextGrad.
Let's walk through the key components with a simple example. Say we want to use GPT-4o to improve a solution to a math problem using TextGrad.
```python
import textgrad as tg
# Step 1: Get an initial response from an LLM.
Expand Down Expand Up @@ -107,7 +107,7 @@ solution = tg.Variable(initial_solution,

# Define the optimizer, let the optimizer know which variables to optimize, and run the loss function

loss_fn = tg.TextLoss("""You will evaluate a solution to a math question. Do not attempt to solve it yourself, do not give a solution, only identify errors. Be super concise.""")
loss_fn = tg.TextLoss("You will evaluate a solution to a math question. Do not attempt to solve it yourself, do not give a solution, only identify errors. Be super concise.")

optimizer = tg.TGD(parameters=[solution])
loss = loss_fn(solution)
Expand Down

0 comments on commit 01ed6f5

Please sign in to comment.