Move the prediction closer to the target and compare the numbers.
target = 4
prediction = 7
print(abs(target - prediction)) Line notes
- Set the known target value.
- Set one prediction.
- Print the distance from the prediction to the target.
Question 1 of 5
A guide says retry_seconds: 15. Counting by spaces gives two pieces, but the model can receive a very different number of units.
Consider the product code KLM-407. A reader sees one item, but a tokenizer may produce separate pieces for the letters, hyphen and digits. Models can use different rules for splitting text. Counting words between spaces therefore cannot tell you exactly how many tokens a request uses.
WHERE TO START
How could you find out how much space a long word takes in a request?
Move the prediction closer to the target and compare the numbers.
target = 4
prediction = 7
print(abs(target - prediction))