Skip to content

Commit 54bc1df

Browse files
committed
Updated util
1 parent 2a7c32a commit 54bc1df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎week7/util.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def run_datapoint(self, i):
5656
truth = float(datapoint["completion"])
5757
error = abs(guess - truth)
5858
color = self.color_for(error, truth)
59-
title = datapoint.title if len(datapoint.title) <= 40 else datapoint.title[:40] + "..."
59+
pieces = datapoint["prompt"].split("Title: ")
60+
title = pieces[1].split("\n")[0] if len(pieces) > 1 else pieces[0]
61+
title = title if len(datapoint.title) <= 40 else title[:40] + "..."
6062
return title, guess, truth, error, color
6163

6264
def chart(self, title):

0 commit comments

Comments
 (0)