Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
knoopx committed Oct 30, 2023
1 parent 33b3fe0 commit a4757b4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ A one-stop-shop for all your LLM needs. Unleash the power of FOSS language model
OLLAMA_ORIGINS="https://knoopx.github.io" ollama serve
```

or:
or add to `/etc/systemd/system/ollama.service`:

``````
Environment="OLLAMA_ORIGINS="https://knoopx.github.io"
echo "Environment=OLLAMA_ORIGINS=http://127.0.0.1:*,http://localhost:*,https://knoopx.github.io" >>/etc/systemd/system/ollama.service.d/environment.conf
``````
```
Environment=OLLAMA_ORIGINS="https://knoopx.github.io"
```

and restart Ollama:

```
systemctl daemon-reload
systemctl restart ollama
```

# Features

Expand All @@ -33,6 +39,7 @@ echo "Environment=OLLAMA_ORIGINS=http://127.0.0.1:*,http://localhost:*,https://k

# Future Ideas

- Cancel generation
- Import/Export chats
- Some kind of Agents
- One-shot Tasks/Apps
Expand Down
7 changes: 3 additions & 4 deletions src/app/ChatConversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ToggleDarkButton } from "./ToggleDarkButton"
import { useStore } from "@/store"
import { VscDebugContinue, VscDebugStart } from "react-icons/vsc"
import { BiArrowToTop } from "react-icons/bi"
import { Textarea } from "@/components/ui/textarea"
import { cn } from "@/lib/utils"
import { AutoTextarea } from "./AutoTextarea"

Expand Down Expand Up @@ -35,16 +34,16 @@ export const ChatConversation = observer(() => {
const { activeChat: chat } = useStore()
return (
<div className="flex flex-col">
<ScrollArea className="flex-auto ">
<div className="mx-auto w-3/5">
<ScrollArea className="flex-auto">
<div className="flex flex-auto flex-col items-center">
{chat.messages.map((message, i) => (
<Message key={i} {...message} />
))}
</div>
</ScrollArea>
<div
className={cn(
"flex-none flex-col flex items-center space-x-4 space-y-2 p-8 min-h-0 mx-auto w-3/5",
"flex-none flex-col flex items-center space-x-4 space-y-2 p-8 min-h-0 mx-auto",
{
hidden: !chat.model,
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/ChatConversationMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Message = observer(({ role, content }) => {
}, [content])

return (
<div ref={ref} className="flex space-x-4 px-8 py-4">
<div ref={ref} className="flex flex-auto space-x-4 px-8 py-4">
<div className="flex flex-col">
<span
className={cn(
Expand All @@ -56,7 +56,7 @@ export const Message = observer(({ role, content }) => {
<Markdown
remarkPlugins={[remarkGfm, remarkMath]}
rehypePlugins={[rehypeHighlight, rehypeKatex]}
className={cn("prose dark:prose-invert", {
className={cn("prose dark:prose-invert min-w-[65ch]", {
"text-muted-foreground": role === "user",
"italic text-muted-foreground": role === "system",
})}
Expand Down
10 changes: 4 additions & 6 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,15 @@
}

@layer base {
html,
body,
#root {
/* @apply min-h-screen overflow-hidden; */
}

* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
}

::-webkit-scrollbar {
display: none;
}
}
5 changes: 5 additions & 0 deletions src/store/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const Store = t
self.activeChat = self.chats[self.chats.length - 1]
},
newChat() {
if (self.models.length === 0) {
alert(
"You currently have models available. Download one first using `ollama pull <model name>`.",
)
}
this.addChat({ model: self?.models[0].name })
},
afterCreate() {
Expand Down

0 comments on commit a4757b4

Please sign in to comment.