Skip to content

Commit ae0ba31

Browse files
authored
Merge pull request ikawrakow#648 from ikawrakow/fcp/missing_token_ps
Fix missing token per second for webui after function call update
2 parents d65c8ce + 608ff76 commit ae0ba31

File tree

5 files changed

+29
-24
lines changed

5 files changed

+29
-24
lines changed
5 Bytes
Binary file not shown.

examples/server/server.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2889,7 +2889,11 @@ static std::vector<json> format_partial_response_oaicompat(server_task_result ta
28892889
};
28902890
streaming_chunks.push_back(finish_chunk);
28912891
}
2892-
2892+
if (server_task_result_dict.count(task_result.id) > 0)
2893+
{
2894+
for (auto& chunk : streaming_chunks)
2895+
chunk.push_back({ "timings", server_task_result_dict[task_result.id].timings.to_json() });
2896+
}
28932897
// Return streaming chunks (could be just final chunk if no diffs)
28942898
if (!streaming_chunks.empty()) {
28952899
return streaming_chunks;

examples/server/webui/dist/index.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

examples/server/webui/src/components/SettingDialog.tsx

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,26 @@ const SETTING_SECTIONS = (
228228
localConfig: typeof CONFIG_DEFAULT,
229229
setLocalConfig: (config: typeof CONFIG_DEFAULT) => void
230230
): SettingSection[] => [
231+
{
232+
title: (
233+
<>
234+
<BookmarkIcon className={ICON_CLASSNAME} />
235+
Presets
236+
</>
237+
),
238+
fields: [
239+
{
240+
type: SettingInputType.CUSTOM,
241+
key: 'custom', // dummy key for presets
242+
component: () => (
243+
<PresetsManager
244+
currentConfig={localConfig}
245+
onLoadPreset={setLocalConfig}
246+
/>
247+
),
248+
},
249+
],
250+
},
231251
{
232252
title: (
233253
<>
@@ -489,26 +509,7 @@ const SETTING_SECTIONS = (
489509
},
490510
],
491511
},
492-
{
493-
title: (
494-
<>
495-
<BookmarkIcon className={ICON_CLASSNAME} />
496-
Presets
497-
</>
498-
),
499-
fields: [
500-
{
501-
type: SettingInputType.CUSTOM,
502-
key: 'custom', // dummy key for presets
503-
component: () => (
504-
<PresetsManager
505-
currentConfig={localConfig}
506-
onLoadPreset={setLocalConfig}
507-
/>
508-
),
509-
},
510-
],
511-
},
512+
512513
];
513514

514515
export default function SettingDialog({

examples/server/webui/src/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ html {
4848
.chat-bubble-base-300 {
4949
--tw-bg-opacity: 1;
5050
--tw-text-opacity: 1;
51-
@apply bg-base-300 text-base-content;
51+
@apply break-words bg-base-300 text-base-content;
5252
}
5353

5454
/* Highlight.js */

0 commit comments

Comments
 (0)