@@ -121,22 +121,24 @@ <h2 class="font-bold ml-4">Conversations</h2>
121121 </ div >
122122 < div v-for ="msg in messages " class ="group ">
123123 < message-bubble
124+ :config ="config "
124125 :msg ="msg "
125126 :key ="msg.id "
126127 :is-generating ="isGenerating "
127128 :edit-user-msg-and-regenerate ="editUserMsgAndRegenerate "
128129 :regenerate-msg ="regenerateMsg "> </ message-bubble >
129130 </ div >
130131
131-
132-
133132 <!-- pending (ongoing) assistant message -->
134- < div id ="pending-msg " class ="chat chat-start ">
135- < div v-if ="pendingMsg " class ="chat-bubble markdown chat-bubble-base-300 ">
136- < span v-if ="!pendingMsg.content " class ="loading loading-dots loading-md "> </ span >
137- < vue-markdown v-else :source ="pendingMsg.content " />
138- </ div >
139- </ div >
133+ < div id ="pending-msg "> </ div >
134+ < message-bubble
135+ v-if ="pendingMsg "
136+ :config ="config "
137+ :msg ="pendingMsg "
138+ :key ="pendingMsg.id "
139+ :is-generating ="isGenerating "
140+ :edit-user-msg-and-regenerate ="() => {} "
141+ :regenerate-msg ="() => {} "> </ message-bubble >
140142 </ div >
141143
142144 <!-- chat input -->
@@ -199,7 +201,7 @@ <h3 class="text-lg font-bold mb-6">Settings</h3>
199201 < summary class ="collapse-title font-bold "> Advanced config</ summary >
200202 < div class ="collapse-content ">
201203 < div class ="flex flex-row items-center mb-2 ">
202- < input type ="checkbox " class ="checkbox " v-model ="config.show_tokens_per_second " />
204+ < input type ="checkbox " class ="checkbox " v-model ="config.showTokensPerSecond " />
203205 < span class ="ml-4 "> Show tokens per second</ span >
204206 </ div >
205207 < label class ="form-control mb-2 ">
@@ -243,12 +245,30 @@ <h3 class="text-lg font-bold mb-6">Settings</h3>
243245 < button class ="btn btn-ghost mt-2 mr-2 " @click ="editingContent = null "> Cancel</ button >
244246 < button class ="btn mt-2 " @click ="editMsg() "> Submit</ button >
245247 </ template >
246- <!-- render message as markdown -->
247- < vue-markdown v-else :source ="msg.content " />
248+ < template v-else >
249+ <!-- show loading dots for pending message -->
250+ < span v-if ="msg.content === null " class ="loading loading-dots loading-md "> </ span >
251+ <!-- render message as markdown -->
252+ < vue-markdown v-else :source ="msg.content "> </ vue-markdown >
253+ <!-- render timings if enabled -->
254+ < div class ="dropdown dropdown-hover dropdown-top mt-2 " v-if ="timings && config.showTokensPerSecond ">
255+ < div tabindex ="0 " role ="button " class ="cursor-pointer font-semibold text-sm opacity-70 "> Speed: {{ timings.predicted_per_second.toFixed(1) }} t/s</ div >
256+ < div class ="dropdown-content bg-base-100 z-10 w-64 p-2 shadow mt-4 ">
257+ < b > Prompt</ b > < br />
258+ - Tokens: {{ timings.prompt_n }}< br />
259+ - Time: {{ timings.prompt_ms }} ms< br />
260+ - Speed: {{ timings.prompt_per_second.toFixed(1) }} t/s< br />
261+ < b > Generation</ b > < br />
262+ - Tokens: {{ timings.predicted_n }}< br />
263+ - Time: {{ timings.predicted_ms }} ms< br />
264+ - Speed: {{ timings.predicted_per_second.toFixed(1) }} t/s< br />
265+ </ div >
266+ </ div >
267+ </ template >
248268 </ div >
249269 </ div >
250270 <!-- actions for each message -->
251- < div :class ="{'text-right': msg.role === 'user'} " class ="mx-4 mt-2 mb-2 ">
271+ < div :class ="{'text-right': msg.role === 'user', 'opacity-0': isGenerating } " class ="mx-4 mt-2 mb-2 ">
252272 <!-- user message -->
253273 < button v-if ="msg.role === 'user' " class ="badge btn-mini show-on-hover " @click ="editingContent = msg.content " :disabled ="isGenerating ">
254274 ✍️ Edit
0 commit comments