Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Oct 12, 2024
1 parent f870f36 commit 0d90f65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/misc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from 'partial-json'
import { Allow, parse } from 'partial-json'
import { responseToAsyncIterator } from './streaming'
import { promplateBaseUrl } from './constants'
import type { ChatMessage } from '@/types'
Expand Down Expand Up @@ -61,15 +61,15 @@ class API {

const res = await fetch(`${promplateBaseUrl}/single/suggest`, {
method: 'PUT',
body: JSON.stringify({ messages, model: 'llama3-70b-8192', prefill: true }),
body: JSON.stringify({ messages, model: 'Qwen/Qwen2-7B-Instruct' }),
headers: { 'content-type': 'application/json' },
})

let json = ''

for await (const delta of responseToAsyncIterator(res)) {
json += delta
yield parse(json) as string[]
yield parse(json, Allow.ARR) as string[]
}
}

Expand Down

1 comment on commit 0d90f65

@vercel
Copy link

@vercel vercel bot commented on 0d90f65 Oct 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.