Spaces:
Runtime error
Runtime error
matt HOFFNER
commited on
Commit
Β·
a942b58
1
Parent(s):
c79b0f3
UX
Browse files
src/components/ChatWindow.jsx
CHANGED
|
@@ -26,10 +26,14 @@ function ChatWindow({
|
|
| 26 |
|
| 27 |
const isReady = loadingStatus.progress === 1;
|
| 28 |
|
| 29 |
-
const
|
| 30 |
deleteMessages();
|
| 31 |
}
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
const handleSubmit = useCallback(async () => {
|
| 34 |
if (isGenerating || !isReady) {
|
| 35 |
return;
|
|
@@ -153,7 +157,7 @@ function ChatWindow({
|
|
| 153 |
</Button>
|
| 154 |
|
| 155 |
<FileLoader setFileText={setFileText} />
|
| 156 |
-
<Button onClick={
|
| 157 |
</div>
|
| 158 |
|
| 159 |
<div
|
|
|
|
| 26 |
|
| 27 |
const isReady = loadingStatus.progress === 1;
|
| 28 |
|
| 29 |
+
const handleClearChat = () => {
|
| 30 |
deleteMessages();
|
| 31 |
}
|
| 32 |
|
| 33 |
+
const handleClearFile = () => {
|
| 34 |
+
setFileText(null);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
const handleSubmit = useCallback(async () => {
|
| 38 |
if (isGenerating || !isReady) {
|
| 39 |
return;
|
|
|
|
| 157 |
</Button>
|
| 158 |
|
| 159 |
<FileLoader setFileText={setFileText} />
|
| 160 |
+
<Button onClick={handleClearChat}>Clear Chat</Button>
|
| 161 |
</div>
|
| 162 |
|
| 163 |
<div
|
src/components/FileEmbedder.tsx
CHANGED
|
@@ -42,9 +42,9 @@ export const FileEmbedder: React.FC<FileEmbedderProps> = ({ handleEmbed }) => {
|
|
| 42 |
>
|
| 43 |
<input {...getInputProps()} />
|
| 44 |
{isDragActive ? (
|
| 45 |
-
<p>Drop the
|
| 46 |
) : (
|
| 47 |
-
<p
|
| 48 |
)}
|
| 49 |
</div>
|
| 50 |
<aside>
|
|
|
|
| 42 |
>
|
| 43 |
<input {...getInputProps()} />
|
| 44 |
{isDragActive ? (
|
| 45 |
+
<p>Drop the file here...</p>
|
| 46 |
) : (
|
| 47 |
+
<p style={{ cursor: 'pointer' }}>Click here or drag and drop file here (PDF, MD, TXT), then press Embed</p>
|
| 48 |
)}
|
| 49 |
</div>
|
| 50 |
<aside>
|
src/components/Loader.jsx
CHANGED
|
@@ -29,7 +29,8 @@ const Loader = () => {
|
|
| 29 |
flexDirection: "column",
|
| 30 |
gap: "10px",
|
| 31 |
fontSize: "24px",
|
| 32 |
-
textAlign: "center"
|
|
|
|
| 33 |
}}
|
| 34 |
>
|
| 35 |
<div className="lg:hidden">
|
|
@@ -55,7 +56,7 @@ const Loader = () => {
|
|
| 55 |
</div>
|
| 56 |
<div>
|
| 57 |
This will download the model (~4GB) and may take a few minutes. After the
|
| 58 |
-
first time, it will be cached.
|
| 59 |
</div>
|
| 60 |
|
| 61 |
<button
|
|
|
|
| 29 |
flexDirection: "column",
|
| 30 |
gap: "10px",
|
| 31 |
fontSize: "24px",
|
| 32 |
+
textAlign: "center",
|
| 33 |
+
fontFamily: "\"Comic Sans MS\", cursive, sans-serif;"
|
| 34 |
}}
|
| 35 |
>
|
| 36 |
<div className="lg:hidden">
|
|
|
|
| 56 |
</div>
|
| 57 |
<div>
|
| 58 |
This will download the model (~4GB) and may take a few minutes. After the
|
| 59 |
+
first time, it will be cached.
|
| 60 |
</div>
|
| 61 |
|
| 62 |
<button
|