Skip to content

[Inference snippets]: no need to showcase max_tokens #1401

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/inference/src/snippets/getInferenceSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const prepareConversationalInput = (
return {
messages: opts?.messages ?? getModelInputSnippet(model),
...(opts?.temperature ? { temperature: opts?.temperature } : undefined),
max_tokens: opts?.max_tokens ?? 512,
...(opts?.max_tokens ? { max_tokens: opts?.max_tokens } : undefined),
...(opts?.top_p ? { top_p: opts?.top_p } : undefined),
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const chatCompletion = await client.chatCompletion({
content: "What is the capital of France?",
},
],
max_tokens: 512,
}, {
billTo: "huggingface",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const chatCompletion = await client.chat.completions.create({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def query(payload):
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.1-8B-Instruct"
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ curl https://router.huggingface.co/hf-inference/models/meta-llama/Llama-3.1-8B-I
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.1-8B-Instruct",
"stream": false
}'
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const chatCompletion = await client.chatCompletion({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const chatCompletion = await client.chatCompletion({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const chatCompletion = await client.chat.completions.create({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const chatCompletion = await client.chat.completions.create({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def query(payload):
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.1-8B-Instruct"
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def query(payload):
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "<together alias for meta-llama/Llama-3.1-8B-Instruct>"
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ curl https://router.huggingface.co/hf-inference/models/meta-llama/Llama-3.1-8B-I
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.1-8B-Instruct",
"stream": false
}'
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ curl https://api.together.xyz/v1/chat/completions \
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "<together alias for meta-llama/Llama-3.1-8B-Instruct>",
"stream": false
}'
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const stream = client.chatCompletionStream({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

for await (const chunk of stream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const stream = client.chatCompletionStream({
content: "What is the capital of France?",
},
],
max_tokens: 512,
});

for await (const chunk of stream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const stream = await client.chat.completions.create({
content: "What is the capital of France?",
},
],
max_tokens: 512,
stream: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const stream = await client.chat.completions.create({
content: "What is the capital of France?",
},
],
max_tokens: 512,
stream: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
stream=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
stream=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
stream=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"content": "What is the capital of France?"
}
],
max_tokens=512,
stream=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def query(payload):
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.1-8B-Instruct",
"stream": True,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def query(payload):
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "<together alias for meta-llama/Llama-3.1-8B-Instruct>",
"stream": True,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ curl https://router.huggingface.co/hf-inference/models/meta-llama/Llama-3.1-8B-I
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.1-8B-Instruct",
"stream": true
}'
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ curl https://api.together.xyz/v1/chat/completions \
"content": "What is the capital of France?"
}
],
"max_tokens": 512,
"model": "<together alias for meta-llama/Llama-3.1-8B-Instruct>",
"stream": true
}'
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const chatCompletion = await client.chatCompletion({
],
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const chatCompletion = await client.chatCompletion({
],
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const chatCompletion = await client.chat.completions.create({
],
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const chatCompletion = await client.chat.completions.create({
],
},
],
max_tokens: 512,
});

console.log(chatCompletion.choices[0].message);
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
]
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
]
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
]
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
]
}
],
max_tokens=512,
)

print(completion.choices[0].message)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def query(payload):
]
}
],
"max_tokens": 512,
"model": "<fireworks-ai alias for meta-llama/Llama-3.2-11B-Vision-Instruct>"
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def query(payload):
]
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.2-11B-Vision-Instruct"
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ curl https://api.fireworks.ai/inference/v1/chat/completions \
]
}
],
"max_tokens": 512,
"model": "<fireworks-ai alias for meta-llama/Llama-3.2-11B-Vision-Instruct>",
"stream": false
}'
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ curl https://router.huggingface.co/hf-inference/models/meta-llama/Llama-3.2-11B-
]
}
],
"max_tokens": 512,
"model": "meta-llama/Llama-3.2-11B-Vision-Instruct",
"stream": false
}'
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const stream = client.chatCompletionStream({
],
},
],
max_tokens: 512,
});

for await (const chunk of stream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const stream = client.chatCompletionStream({
],
},
],
max_tokens: 512,
});

for await (const chunk of stream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const stream = await client.chat.completions.create({
],
},
],
max_tokens: 512,
stream: true,
});

Expand Down
Loading
Loading