Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
javisperez committed Nov 28, 2024
1 parent 3f3e787 commit 4fc2124
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/dev-mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"typescript": "~5.4.4",
"unplugin-icons": "^0.16.6",
"vite": "^5.2.8",
"vite-plugin-dynamic-import": "^1.6.0",
"vue-tsc": "^2.0.12"
},
"packageManager": "[email protected]"
Expand Down
16 changes: 16 additions & 0 deletions frontend/dev-mode/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/dev-mode/src/components/ChatPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const isPending = inject('isPending', false)
const isChatStarted = inject('isChatStarted', false)
const runChat = inject('runChat', (message: string) => message)
const runCompletion = inject('runCompletion', () => {})
const stop = inject('stop', () => {})
const stop = inject('stop', (e: Event) => e)
const uploadImage = inject('uploadImage', () => {})
const send = (customMessage: string = '') => {
Expand Down Expand Up @@ -175,7 +175,7 @@ useResizeObserver(resultsContainer, () => {
</div>
</div>

<form @submit.prevent="isGenerating ? stop : send"
<form @submit.prevent="(e: Event) => isGenerating ? stop(e) : send()"
class="flex gap-6 w-full"
:class="{
'mb-[28px]': !stats
Expand Down
1 change: 0 additions & 1 deletion frontend/dev-mode/src/components/InputCodeSnippets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ main();
`)
const shSnippet = computed(() => `invoke_url='${apiUrl}/v1/chat/completions'
${
parameters.value.api_key
? 'authorization_header=\'Authorization: Bearer '+parameters.value.api_key+'\''
Expand Down
1 change: 1 addition & 0 deletions frontend/dev-mode/src/components/ui/CodeHighlighter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ watch([() => props.code, () => props.language], highlightCode)
.highlighted-code > [class*="shj-lang-"] {
@apply rounded-none mt-0 p-3 pt-10;
@apply text-base leading-normal;
}
</style>

Expand Down
2 changes: 1 addition & 1 deletion frontend/dev-mode/src/composables/useLlama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default function useLlama(parameters?: MaybeRef<Parameters>, localSession
}
}

session.value.response.push(...currentMessages)
session.value.response.push(currentMessages as any)
} catch (e) {
if (!(e instanceof DOMException) || e.name !== 'AbortError') {
console.error(e)
Expand Down
9 changes: 8 additions & 1 deletion frontend/dev-mode/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ import { URL, fileURLToPath } from 'node:url'
import vue from '@vitejs/plugin-vue'
import icons from 'unplugin-icons/vite'
import { defineConfig } from 'vite'
import dynamicImport from 'vite-plugin-dynamic-import'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
icons({ autoInstall: true })
icons({ autoInstall: true }),
dynamicImport({
filter(id: string) {
if (id.includes('@speed-highlight/core'))
return true
}
})
],
resolve: {
alias: {
Expand Down

0 comments on commit 4fc2124

Please sign in to comment.