Skip to content

Commit 599a161

Browse files
authored
fix: uncaught exception (#430)
* fix: uncaught exception * fix(Electron template): non-latin text formatting * docs: update DeepSeek
1 parent ca6b901 commit 599a161

File tree

7 files changed

+24
-5
lines changed

7 files changed

+24
-5
lines changed

docs/blog/v3.6-deepseek-r1.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: DeepSeek R1 with function calling
3-
date: 2025-02-21T15:00:00Z
3+
date: 2025-02-21T19:00:00Z
44
lastUpdated: false
55
author:
66
name: Gilad S.
@@ -90,6 +90,10 @@ Here are some recommended model URIs you can use to try out DeepSeek R1 with fun
9090
| [DeepSeek R1 Distill Qwen 14B](https://huggingface.co/mradermacher/DeepSeek-R1-Distill-Qwen-14B-GGUF) | 8.99GB | `hf:mradermacher/DeepSeek-R1-Distill-Qwen-14B-GGUF:Q4_K_M` |
9191
| [DeepSeek R1 Distill Qwen 32B](https://huggingface.co/mradermacher/DeepSeek-R1-Distill-Qwen-32B-GGUF) | 19.9GB | `hf:mradermacher/DeepSeek-R1-Distill-Qwen-32B-GGUF:Q4_K_M` |
9292

93+
> The 7B model works well with function calling in the first prompt, but tends to deteriorate in subsequent queries.
94+
> <br/>
95+
> Use a larger model for better performance with multiple prompts.
96+
9397
::: info TIP
9498
Estimate the compatibility of a model with your machine before downloading it using the [`inspect estimate`](../cli/inspect/estimate.md) command:
9599
```shell

src/evaluator/LlamaChatSession/utils/LlamaChatSessionPromptCompletionEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class LlamaChatSessionPromptCompletionEngine {
164164
return this._restartCompletion(completionCache);
165165
})
166166
.catch((err) => {
167-
if (currentAbortSignal.aborted && err === currentAbortSignal.reason)
167+
if ((currentAbortSignal.aborted && err === currentAbortSignal.reason) || err instanceof DOMException)
168168
return;
169169

170170
console.error(getConsoleLogPrefix(false, false), err);

templates/electron-typescript-react/src/App/components/ChatHistory/components/ModelResponseThought/ModelResponseThought.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
margin-bottom: 24px;
122122
opacity: 0.64;
123123
padding-left: 24px;
124+
justify-self: flex-start;
124125
position: relative;
125126
overflow: clip;
126127

@@ -133,7 +134,7 @@
133134
width: 4px;
134135
height: 100%;
135136
background-color: var(--message-blockquote-border-color);
136-
inset-inline-start: 0px;
137+
left: 0px;
137138
}
138139

139140
&.hide {

templates/electron-typescript-react/src/App/components/ChatHistory/components/ModelResponseThought/ModelResponseThought.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ export function ModelResponseThought({text, active, duration}: ModelResponseThou
3636
<div className="title">{title}</div>
3737
<RightChevronIconSVG className="chevron" />
3838
</span>
39-
<MarkdownContent className={classNames("excerpt", isOpen && "hide")} inline>{text.slice(-excerptLength)}</MarkdownContent>
39+
<MarkdownContent
40+
className={classNames("excerpt", isOpen && "hide")}
41+
dir="auto"
42+
inline
43+
>
44+
{text.slice(-excerptLength)}
45+
</MarkdownContent>
4046
</button>
4147
<MessageMarkdown className={classNames("content", !isOpen && "hide")} activeDot={active}>{text}</MessageMarkdown>
4248
</div>;

templates/electron-typescript-react/src/App/components/InputRow/InputRow.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@
8282
display: inline;
8383
white-space: pre-wrap;
8484
word-break: break-word;
85+
unicode-bidi: normal;
8586
}
8687

8788
> .completion {
8889
display: inline;
8990
white-space: pre-wrap;
9091
word-break: break-word;
92+
unicode-bidi: normal;
9193
}
9294

9395
> .pressTab {

templates/electron-typescript-react/src/App/components/MarkdownContent/MarkdownContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const md = markdownit({
1818
}
1919
});
2020

21-
export function MarkdownContent({children, inline = false, className}: MarkdownContentProps) {
21+
export function MarkdownContent({children, inline = false, dir, className}: MarkdownContentProps) {
2222
const divRef = useRef<HTMLDivElement>(null);
2323

2424
useLayoutEffect(() => {
@@ -34,11 +34,13 @@ export function MarkdownContent({children, inline = false, className}: MarkdownC
3434
return <div
3535
className={className}
3636
ref={divRef}
37+
dir={dir}
3738
/>;
3839
}
3940

4041
type MarkdownContentProps = {
4142
className?: string,
4243
inline?: boolean,
44+
dir?: string,
4345
children: string
4446
};

templates/electron-typescript-react/src/App/components/MessageMarkdown/MessageMarkdown.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
margin-bottom: 0px;
3131
}
3232

33+
* {
34+
unicode-bidi: plaintext;
35+
}
36+
3337
h2 {
3438
margin: 16px 0px;
3539
padding-top: 24px;

0 commit comments

Comments
 (0)