Skip to content

Commit

Permalink
fix undefined keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mishig25 committed Oct 22, 2024
1 parent a444cac commit 5bc694b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/tasks/src/snippets/curl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export const snippetTextGeneration = (
];

const config = {
temperature: opts?.temperature,
...(opts?.temperature ? { temperature: opts.temperature } : undefined),
max_tokens: opts?.max_tokens ?? 500,
top_p: opts?.top_p,
...(opts?.top_p ? { top_p: opts.top_p } : undefined),
};
return {
content: `curl 'https://api-inference.huggingface.co/models/${model.id}/v1/chat/completions' \\
Expand Down
4 changes: 2 additions & 2 deletions packages/tasks/src/snippets/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export const snippetTextGeneration = (
const messagesStr = formatGenerationMessages({ messages, sep: ",\n\t\t", start: "[\n\t\t", end: "\n\t]" });

const config = {
temperature: opts?.temperature,
...(opts?.temperature ? { temperature: opts.temperature } : undefined),
max_tokens: opts?.max_tokens ?? 500,
top_p: opts?.top_p,
...(opts?.top_p ? { top_p: opts.top_p } : undefined),
};
const configStr = formatGenerationConfig({ config, sep: ",\n\t", start: "", end: "" });

Expand Down
4 changes: 2 additions & 2 deletions packages/tasks/src/snippets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export const snippetConversational = (
const messagesStr = formatGenerationMessages({ messages, sep: ",\n\t", start: `[\n\t`, end: `\n]` });

const config = {
temperature: opts?.temperature,
...(opts?.temperature ? { temperature: opts.temperature } : undefined),
max_tokens: opts?.max_tokens ?? 500,
top_p: opts?.top_p,
...(opts?.top_p ? { top_p: opts.top_p } : undefined),
};
const configStr = formatGenerationConfig({ config, sep: ",\n\t", start: "", end: "", connector: "=" });

Expand Down

0 comments on commit 5bc694b

Please sign in to comment.