Skip to content

Commit

Permalink
Oobabooga-specific API is deprecated!
Browse files Browse the repository at this point in the history
  • Loading branch information
lmg-anon committed Nov 17, 2023
1 parent 2d13e45 commit d734e4a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mikupad.html
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@
return data.map(item => item.id);
}

function openaiConvertOptions(options) {
function openaiConvertOptions(options, isOpenAI) {
const swapOption = (lhs, rhs) => {
if (lhs in options) {
options[rhs] = options[lhs];
Expand All @@ -778,7 +778,7 @@
if (options.n_predict === -1) {
options.n_predict = 1024;
}
if (options.n_probs > 5) {
if (isOpenAI && options.n_probs > 5) {
options.n_probs = 5;
}
swapOption("n_ctx", "max_context_length");
Expand All @@ -795,7 +795,7 @@
'Authorization': `Bearer ${endpointAPIKey}`,
},
body: JSON.stringify({
...openaiConvertOptions(options),
...openaiConvertOptions(options, endpoint.toLowerCase().includes("openai.com")),
stream: true,
}),
signal,
Expand Down Expand Up @@ -854,7 +854,7 @@
</option>`)}
</datalist>`}
${tooltip && html`
<span class="tooltiptext ${tooltipSize || ""}">
<span class="tooltiptext ${tooltipSize || ''}">
${tooltip}
</span>`}
</label>`;
Expand Down Expand Up @@ -1887,7 +1887,7 @@
onValueChange=${switchEndpointAPI}
options=${[
{ name: 'llama.cpp', value: 0 },
{ name: 'oobabooga', value: 1 },
{ name: 'legacy oobabooga', value: 1 },
{ name: 'koboldcpp', value: 2 },
{ name: 'openai', value: 3 },
]}/>
Expand Down

0 comments on commit d734e4a

Please sign in to comment.