From 0f2df721ce727baca5147b848282ef4e2bb22e85 Mon Sep 17 00:00:00 2001 From: Chris Kerwell Gresla Date: Sat, 7 Oct 2023 13:32:51 -0700 Subject: [PATCH 1/2] specified version of Werzkug -- prevents import or a url issue with python=3.11.0 --- server/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/server/requirements.txt b/server/requirements.txt index 12a741f..be79366 100755 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -14,3 +14,4 @@ six==1.16.0 sseclient==0.0.27 torch==2.0.0 transformers==4.27.1 +Werkzeug==2.2.2 \ No newline at end of file From e5cfee7383d123df7c2a47975af318236753668e Mon Sep 17 00:00:00 2001 From: Chris Kerwell Gresla Date: Sat, 7 Oct 2023 14:55:25 -0700 Subject: [PATCH 2/2] added in the logic to measure and display time to first token in the models compare page --- app/src/pages/compare.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/pages/compare.tsx b/app/src/pages/compare.tsx index b9fbfc7..954a6df 100755 --- a/app/src/pages/compare.tsx +++ b/app/src/pages/compare.tsx @@ -63,10 +63,17 @@ const ModelCardStats = (props: any) => { const [isTimerRunning, setIsTimerRunning] = useState(false); const intervalRef = useRef(null); const [time, setTime] = useState(0); + const [timeToFirstToken, setFirstTokenTime] = useState(0); + const [receivedFirstToken, setReceivedFirstToken] = useState(false); useEffect(() => { if (is_running && isTimerRunning === false) { startTimer() + if (!receivedFirstToken){ + let first_token_time = intervalRef.current >= 1000 ? `${intervalRef.current} s` : `${intervalRef.current} ms` + setFirstTokenTime(first_token_time) + setReceivedFirstToken(false) + } } else if (!is_running && isTimerRunning === true) { stopTimer() } @@ -121,7 +128,9 @@ const ModelCardStats = (props: any) => { return (
- {formatTime(time)} + First: {timeToFirstToken} + + Total: {formatTime(time)}