mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 05:48:47 +01:00
server : detect search query to start webchat (#6554)
This commit is contained in:
parent
5dc9dd7152
commit
400d5d722d
File diff suppressed because it is too large
Load Diff
@ -406,7 +406,7 @@
|
|||||||
throw new Error("already running");
|
throw new Error("already running");
|
||||||
}
|
}
|
||||||
controller.value = new AbortController();
|
controller.value = new AbortController();
|
||||||
for await (const chunk of llama(prompt, llamaParams, { controller: controller.value, api_url: document.baseURI.replace(/\/+$/, '') })) {
|
for await (const chunk of llama(prompt, llamaParams, { controller: controller.value, api_url: location.pathname.replace(/\/+$/, '') })) {
|
||||||
const data = chunk.data;
|
const data = chunk.data;
|
||||||
|
|
||||||
if (data.stop) {
|
if (data.stop) {
|
||||||
@ -1015,6 +1015,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function App(props) {
|
function App(props) {
|
||||||
|
useEffect(() => {
|
||||||
|
const query = new URLSearchParams(location.search).get("q");
|
||||||
|
if (query) chat(query);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="mode-${session.value.type}">
|
<div class="mode-${session.value.type}">
|
||||||
|
Loading…
Reference in New Issue
Block a user