mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 17:25:07 +02:00
Merge branch 'upstream' into concedo_experimental
# Conflicts: # ggml/src/ggml-sycl/ggml-sycl.cpp # pyproject.toml
This commit is contained in:
Binary file not shown.
@@ -146,6 +146,7 @@ struct slot_params {
|
||||
{"top_k", sampling.top_k},
|
||||
{"top_p", sampling.top_p},
|
||||
{"min_p", sampling.min_p},
|
||||
{"top_n_sigma", sampling.top_n_sigma},
|
||||
{"xtc_probability", sampling.xtc_probability},
|
||||
{"xtc_threshold", sampling.xtc_threshold},
|
||||
{"typical_p", sampling.typ_p},
|
||||
@@ -248,6 +249,7 @@ struct server_task {
|
||||
params.sampling.top_k = json_value(data, "top_k", defaults.sampling.top_k);
|
||||
params.sampling.top_p = json_value(data, "top_p", defaults.sampling.top_p);
|
||||
params.sampling.min_p = json_value(data, "min_p", defaults.sampling.min_p);
|
||||
params.sampling.top_n_sigma = json_value(data, "top_n_sigma", defaults.sampling.top_n_sigma);
|
||||
params.sampling.xtc_probability = json_value(data, "xtc_probability", defaults.sampling.xtc_probability);
|
||||
params.sampling.xtc_threshold = json_value(data, "xtc_threshold", defaults.sampling.xtc_threshold);
|
||||
params.sampling.typ_p = json_value(data, "typical_p", defaults.sampling.typ_p);
|
||||
|
||||
@@ -157,6 +157,9 @@ export default function ChatScreen() {
|
||||
clearExtraContext();
|
||||
};
|
||||
|
||||
// for vscode context
|
||||
textarea.refOnSubmit.current = sendNewMessage;
|
||||
|
||||
const handleEditMessage = async (msg: Message, content: string) => {
|
||||
if (!viewingChat) return;
|
||||
setCurrNodeId(msg.id);
|
||||
|
||||
@@ -37,6 +37,7 @@ export interface ChatTextareaApi {
|
||||
setValue: (value: string) => void;
|
||||
focus: () => void;
|
||||
ref: React.RefObject<HTMLTextAreaElement>;
|
||||
refOnSubmit: React.MutableRefObject<(() => void) | null>; // Submit handler
|
||||
onInput: (event: React.FormEvent<HTMLTextAreaElement>) => void; // Input handler
|
||||
}
|
||||
|
||||
@@ -46,6 +47,7 @@ export interface ChatTextareaApi {
|
||||
export function useChatTextarea(initValue: string): ChatTextareaApi {
|
||||
const [savedInitValue, setSavedInitValue] = useState<string>(initValue);
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
const onSubmitRef = useRef<(() => void) | null>(null);
|
||||
|
||||
// Effect to set initial value and height on mount or when initValue changes
|
||||
useEffect(() => {
|
||||
@@ -91,6 +93,7 @@ export function useChatTextarea(initValue: string): ChatTextareaApi {
|
||||
}
|
||||
},
|
||||
ref: textareaRef,
|
||||
refOnSubmit: onSubmitRef,
|
||||
onInput: handleInput,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ export const useVSCodeContext = (textarea: ChatTextareaApi) => {
|
||||
});
|
||||
}
|
||||
textarea.focus();
|
||||
setTimeout(() => {
|
||||
textarea.refOnSubmit.current?.();
|
||||
}, 10); // wait for setExtraContext to finish
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user