- {
- hide_pending ?
-
:
-
+
> :
diff --git a/src/styles/chat.css b/src/styles/chat.css
index b2805b3..dd9b4dc 100644
--- a/src/styles/chat.css
+++ b/src/styles/chat.css
@@ -142,7 +142,8 @@
position: absolute;
bottom: 0;
left: 0;
- display: block;
+ display: flex;
+ align-items: center;
overflow: hidden;
background-color: var(--normal-bg-color);
}
@@ -186,41 +187,62 @@
animation-delay: .8s;
}
-.chat > .conversation-main > .send-message-form >
-input[type="text"] {
+.chat > .conversation-main > .send-message-form > .input-container {
width: calc(100% - 20px);
- margin-left: 10px;
- margin-top: 10px;
- position: relative;
height: var(--elem-size);
- border: 1px solid lightgray;
+ position: relative;
+ margin: auto;
+ border: 2px solid lightgray;
+ overflow: hidden;
border-radius: 30px;
+}
+
+.chat > .conversation-main > .send-message-form > .input-container >
+input[type="text"] {
+ width: 100%;
+ height: 100%;
+ position: relative;
+ border: none;
padding: 0px var(--elem-size) 0px 10px;
}
-.chat > .conversation-main > .send-message-form >
+.chat > .conversation-main > .send-message-form > .input-container >
input[type="text"]:focus {
outline: none;
}
-.chat > .conversation-main > .send-message-form >
-.send-message-button-container {
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container {
position: absolute;
width: var(--elem-size);
height: var(--elem-size);
- right: 10px;
- top: 10px;
+ right: 0;
+ top: 0;
display: flex;
+ z-index: 1;
+ background-color: rgba(230, 230, 230, 0.6);
+}
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container.file-upload {
+ right: unset;
+ left: 0;
}
-.chat > .conversation-main > .send-message-form >
-.send-message-button-container:hover > .button-icon:not(.stop) {
+.chat > .conversation-main >
+.send-message-form > .input-container:has(>.button-container.file-upload) >
+input[type="text"] {
+ padding-left: calc(5px + var(--elem-size));
+}
+
+
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container:hover > .button-icon.animated {
transform: rotate(45deg);
}
-.chat > .conversation-main > .send-message-form >
-.send-message-button-container > input[type="submit"]{
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container > input{
width: 100%;
height: 100%;
position: absolute;
@@ -229,13 +251,13 @@ input[type="text"]:focus {
z-index: 2;
opacity: 0;
}
-.chat > .conversation-main > .send-message-form >
-.send-message-button-container > input[type="submit"].disabled {
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container > input.disabled {
pointer-events: none;
}
-.chat > .conversation-main > .send-message-form >
-.send-message-button-container > .button-icon {
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container > .button-icon {
--size: 40%;
width: var(--size);
height: var(--size);
@@ -243,3 +265,8 @@ input[type="text"]:focus {
color: rgb(90, 90, 90);
transition-duration: .3s;
}
+
+.chat > .conversation-main > .send-message-form > .input-container >
+.button-container > .button-icon.highlight {
+ color: dodgerblue;
+}
diff --git a/src/utils/workers/aws-worker.js b/src/utils/workers/aws-worker.js
index d3feb46..6d1eff7 100644
--- a/src/utils/workers/aws-worker.js
+++ b/src/utils/workers/aws-worker.js
@@ -50,7 +50,7 @@ let abort_signal = false;
/**
* @typedef ImageMessage
* @property {"png" | "jpeg" | "gif" | "webp"} format Format of image
- * @property {Buffer} content Content in bytes
+ * @property {Uint8Array} content Content in bytes
*/
/**
@@ -95,7 +95,11 @@ let abort_signal = false;
*/
export async function chatCompletions(messages, cb = null) {
const { aws_model_id } = getPlatformSettings();
- if(!aws_model_id || (!bedrock_client && !await initBedrockClient())) return null;
+ if(!aws_model_id || (!bedrock_client && !await initBedrockClient())) {
+ console.log('no bedrock')
+ cb && cb("**Cannot Initialize AWS Bedrock Client**", true)
+ return null;
+ }
const system = [];
const normal_messages = [];
diff --git a/src/utils/workers/index.js b/src/utils/workers/index.js
index 0902406..f5873c4 100644
--- a/src/utils/workers/index.js
+++ b/src/utils/workers/index.js
@@ -6,7 +6,7 @@ import { chatCompletions as AwsCompletions, abortCompletion as AwsAbort } from "
* @typedef CompletionFunctions
* @property {Function} completions
* @property {Function} abort
- * @property {"Wllama" | "AWS"} type
+ * @property {"Wllama" | "AWS"} platform
*/
/**
@@ -18,9 +18,9 @@ export function getCompletionFunctions() {
switch(platform_settings.enabled_platform ) {
case 'AWS':
- return { completions: AwsCompletions, abort: AwsAbort, type: "AWS" }
+ return { completions: AwsCompletions, abort: AwsAbort, platform: "AWS" }
default:
- return { completions: WllamaCompletions, abort: WllamaAbort, type: "Wllama" }
+ return { completions: WllamaCompletions, abort: WllamaAbort, platform: "Wllama" }
}
}
\ No newline at end of file
diff --git a/src/utils/workers/worker.js b/src/utils/workers/worker.js
index af32abe..4c6325b 100644
--- a/src/utils/workers/worker.js
+++ b/src/utils/workers/worker.js
@@ -64,11 +64,16 @@ export async function deleteModel(type = 'completion') {
await instance.cacheManager.delete(cacheKey);
}
-export async function loadModel(type = 'completion') {
+export async function loadModel(type = 'completion', cb = null) {
// check if model already in cache
const { instance, model_src } = engines[type];
try {
+ // if not downloaded, download first
+ if(!await isModelDownloaded(type)) {
+ await downloadModel(type, cb);
+ }
+ cb && cb('loading')
await instance.loadModelFromUrl(model_src, {
n_threads: 6,
n_ctx: 4096,