Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/fix input 2 #345

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
/>

<style>
.backdrop {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: transparent
}
</style>
.backdrop {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: transparent
}
</style>
19 changes: 10 additions & 9 deletions src/lib/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,15 @@
}

const recordToggle = () => {
ttsStop()
if (chatRequest.updating) return
// Check if already recording - if so, stop - else start
if (recording) {
recognition?.stop()
recording = false
} else {
recognition?.start()
}
ttsStop()

Check failure on line 348 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
if (chatRequest.updating) return

Check failure on line 349 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
// Check if already recording - if so, stop - else start

Check failure on line 350 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
if (recording) {

Check failure on line 351 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
recognition?.stop()

Check failure on line 352 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 4 spaces but found 8
recording = false

Check failure on line 353 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 4 spaces but found 8
} else {

Check failure on line 354 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
recognition?.start()

Check failure on line 355 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 4 spaces but found 8
}

Check failure on line 356 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
}

</script>
Expand Down Expand Up @@ -395,6 +395,7 @@
{#if $currentChatId !== 0 && ($currentChatMessages.length === 0 || ($currentChatMessages.length === 1 && $currentChatMessages[0].role === 'system'))}
<Prompts bind:input />
{/if}

</div>
<Footer class="prompt-input-container" strongMask={true}>
<form class="field has-addons has-addons-right is-align-items-flex-end" on:submit|preventDefault={() => submitForm()}>
Expand Down
29 changes: 12 additions & 17 deletions src/lib/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<script lang="ts">
import Fa from 'svelte-fa/src/fa.svelte'
import {
faGithub
} from '@fortawesome/free-brands-svg-icons/index'

let classes = ''
export { classes as class }
export let pin: boolean = false
Expand All @@ -13,15 +8,15 @@ export { classes as class }
<div class="lower-mask section-footer-mask" class:pin-footer={pin}/>
<div class="lower-mask2" class:strong-mask={strongMask} />
<div class="section-footer {classes}" class:pin-footer={pin}>
<slot />
<div class="content has-text-centered credit-footer">
<p>
<strong>ChatGPT-web</strong>
<span class="author">by
<a target="_blank" href="https://niekvandermaas.nl/">Niek van der Maas</a>
</span>
<a target="_blank" class="ml-4" href="https://github.com/Niek/chatgpt-web"><span style="position:absolute" class="icon default-text"><Fa size="2x" icon="{faGithub}"/></span></a>
<span style="display:inline-block;width:30px;height:20px;"></span>
</p>
</div>
</div>
<!--<slot />
<div class="content has-text-centered credit-footer">
<p>
<strong>ChatGPT-web</strong>
<span class="author">by
<a target="_blank" href="https://niekvandermaas.nl/">Niek van der Maas</a>
</span>
<a target="_blank" class="ml-4" href="https://github.com/Niek/chatgpt-web"><span style="position:absolute" class="icon default-text"><Fa size="2x" icon="{faGithub}"/></span></a>
<span style="display:inline-block;width:30px;height:20px;"></span>
</p>
</div> -->
</div>
6 changes: 3 additions & 3 deletions src/lib/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ const setPetalsEnabled = (event: Event) => {
<article class="message" class:is-danger={!hasModels} class:is-warning={!showPetalsSettings} class:is-info={showPetalsSettings}>
<div class="message-body">
<label class="label" for="enablePetals">
<input
<input
type="checkbox"
class="checkbox"
class="checkbox"
id="enablePetals"
checked={!!$globalStorage.enablePetals}
checked={!!$globalStorage.enablePetals}
on:click={setPetalsEnabled}
>
Use Petals API and Models (Llama 2)
Expand Down
36 changes: 13 additions & 23 deletions src/lib/providers/openai/models.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ const chatModelBase = {
} as ModelDetail

// Reference: https://openai.com/pricing#language-models
const gpt35 = {
...chatModelBase,
prompt: 0.0000015, // $0.0015 per 1000 tokens prompt
completion: 0.000002, // $0.002 per 1000 tokens completion
max: 4096 // 4k max token buffer
}
// const gpt35 = {
// ...chatModelBase,
// prompt: 0.0000015, // $0.0015 per 1000 tokens prompt
// completion: 0.000002, // $0.002 per 1000 tokens completion
// max: 4096 // 4k max token buffer
// }
const gpt3516k = {
...chatModelBase,
prompt: 0.000001, // $0.001 per 1000 tokens prompt
Expand All @@ -75,12 +75,12 @@ const gpt4 = {
completion: 0.00006, // $0.06 per 1000 tokens completion
max: 8192 // 8k max token buffer
}
const gpt432k = {
...chatModelBase,
prompt: 0.00006, // $0.06 per 1000 tokens prompt
completion: 0.00012, // $0.12 per 1000 tokens completion
max: 32768 // 32k max token buffer
}
// const gpt432k = {
// ...chatModelBase,
// prompt: 0.00006, // $0.06 per 1000 tokens prompt
// completion: 0.00012, // $0.12 per 1000 tokens completion
// max: 32768 // 32k max token buffer
// }
const gpt4128kpreview = {
...chatModelBase,
prompt: 0.00001, // $0.01 per 1000 tokens prompt
Expand All @@ -90,18 +90,8 @@ const gpt4128kpreview = {

export const chatModels : Record<string, ModelDetail> = {
'gpt-3.5-turbo': { ...gpt3516k },
'gpt-3.5-turbo-0301': { ...gpt35 },
'gpt-3.5-turbo-0613': { ...gpt35 },
'gpt-3.5-turbo-1106': { ...gpt3516k },
'gpt-3.5-turbo-16k': { ...gpt3516k },
'gpt-3.5-turbo-16k-0613': { ...gpt3516k },
'gpt-4': { ...gpt4 },
'gpt-4-0314': { ...gpt4 },
'gpt-4-0613': { ...gpt4 },
'gpt-4-1106-preview': { ...gpt4128kpreview },
'gpt-4-32k': { ...gpt432k },
'gpt-4-32k-0314': { ...gpt432k },
'gpt-4-32k-0613': { ...gpt432k }
'gpt-4-1106-preview': { ...gpt4128kpreview }
}

const imageModelBase = {
Expand Down
Loading