Skip to content

Commit 3cc1f1f

Browse files
authored
webui : handle PDF input (as text or image) + convert pasted long content to file (ggml-org#13562)
* webui : handle PDF input (as text or image) * handle the case where pdf image + server without mtmd * fix bug missing pages
1 parent c753d7b commit 3cc1f1f

File tree

8 files changed

+425
-22
lines changed

8 files changed

+425
-22
lines changed

tools/server/public/index.html.gz

558 KB
Binary file not shown.

tools/server/webui/package-lock.json

Lines changed: 272 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/server/webui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"dexie": "^4.0.11",
2222
"highlight.js": "^11.10.0",
2323
"katex": "^0.16.15",
24+
"pdfjs-dist": "^5.2.133",
2425
"postcss": "^8.4.49",
2526
"react": "^18.3.1",
2627
"react-dom": "^18.3.1",

tools/server/webui/src/Config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export const CONFIG_DEFAULT = {
1616
showTokensPerSecond: false,
1717
showThoughtInProgress: false,
1818
excludeThoughtOnReq: true,
19+
pasteLongTextToFileLen: 2500,
20+
pdfAsImage: false,
1921
// make sure these default values are in sync with `common.h`
2022
samplers: 'edkypmxt',
2123
temperature: 0.8,
@@ -43,6 +45,8 @@ export const CONFIG_DEFAULT = {
4345
export const CONFIG_INFO: Record<string, string> = {
4446
apiKey: 'Set the API Key if you are using --api-key option for the server.',
4547
systemMessage: 'The starting message that defines how model should behave.',
48+
pasteLongTextToFileLen:
49+
'On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.',
4650
samplers:
4751
'The order at which samplers are applied, in simplified way. Default is "dkypmxt": dry->top_k->typ_p->top_p->min_p->xtc->temperature',
4852
temperature:

0 commit comments

Comments
 (0)