Archived
radiance 1.2.4
- EmbeddingGemma 2 (google/embeddinggemma-2): text, image, video and audio embeddings on the card (libr4d) and on the CPU (libavx); prompt_name, Matryoshka dimensions, image budgets, mixed content parts and the messages form on /v1/embeddings - #43: on serves that lend the activation arena to the experts (Qwen3.8-Flash-Next with expert_tiered), every image after the first read its rows from the wrong place -- garbage replies, or an earlier request's image. Fixed - the Qwen vision towers' attention resolves on the card again (broken on main after 1.2.3, never released) - #42: a warning at startup when amdgpu cwsr_enable is 0, and a stalled queue is reported as slow or stuck; the guide covers the GPU-hang-and-reset chain
This commit is contained in:
1 parent
05af4db458
commit
7d840861af
76 files changed
+8324
-467
No files matched your search
+71
-2
@@ -240,8 +240,8 @@ struct FakeGrammar : IGrammarCompiler {
|
||||
* server's own validation of them. */
|
||||
struct FakeMultimodal : IMultimodal {
|
||||
bool accepts(MediaKind) const override { return true; }
|
||||
int prepare(MediaKind, const std::vector<uint8_t>&, std::shared_ptr<mm::Item>* out,
|
||||
std::string*) override {
|
||||
int prepare(MediaKind, const std::vector<uint8_t>&, const MediaOpts&,
|
||||
std::shared_ptr<mm::Item>* out, std::string*) override {
|
||||
auto it = std::make_shared<mm::Item>();
|
||||
it->expand = { 0 };
|
||||
*out = std::move(it);
|
||||
@@ -2807,6 +2807,75 @@ TEST(a_raw_prompt_parses_control_tokens_on_every_endpoint_that_takes_one) {
|
||||
}
|
||||
}
|
||||
|
||||
/* An embedding model's request fields: prompt_name puts the model's named prompt in front of text
|
||||
* and content-part inputs and is refused on token ids and on a name the model does not state;
|
||||
* dimensions must be a positive integer; image_tokens one of the trained budgets; a messages input
|
||||
* renders through the model's template and excludes `input`. */
|
||||
struct FakeEmbedder final : IEmbedder {
|
||||
IChatTemplate* tpl = nullptr;
|
||||
int64_t dim() const override { return 768; }
|
||||
int64_t max_input() const override { return 8192; }
|
||||
bool prompt(const std::string& name, std::string* text) const override {
|
||||
if (name != "query") return false;
|
||||
*text = "task: search result | query: ";
|
||||
return true;
|
||||
}
|
||||
IChatTemplate* message_template() const override { return tpl; }
|
||||
};
|
||||
|
||||
TEST(embeddings_take_the_models_named_prompts_and_its_fields) {
|
||||
Fixture f;
|
||||
FakeEmbedder emb;
|
||||
emb.tpl = &f.tmpl;
|
||||
OaiDeps d = f.odeps();
|
||||
d.embed = &emb;
|
||||
{
|
||||
OaiRequest r; ApiError e;
|
||||
CHECK_OK(parse_embeddings_request(R"({"input":"capital?","prompt_name":"query"})", d,
|
||||
f.limits(), &r, &e));
|
||||
CHECK_EQ(r.prompts.size(), (size_t)1);
|
||||
CHECK_EQ(r.prompts[0].text, std::string("task: search result | query: capital?"));
|
||||
}
|
||||
{
|
||||
OaiRequest r; ApiError e;
|
||||
CHECK_OK(parse_embeddings_request(R"({"input":["a","b"],"prompt_name":"query"})", d,
|
||||
f.limits(), &r, &e));
|
||||
CHECK_EQ(r.prompts.size(), (size_t)2);
|
||||
CHECK_EQ(r.prompts[1].text, std::string("task: search result | query: b"));
|
||||
}
|
||||
{
|
||||
OaiRequest r; ApiError e;
|
||||
CHECK(parse_embeddings_request(R"({"input":"x","prompt_name":"nope"})", d, f.limits(),
|
||||
&r, &e) < 0);
|
||||
CHECK_EQ(e.param, std::string("prompt_name"));
|
||||
}
|
||||
{
|
||||
OaiRequest r; ApiError e;
|
||||
CHECK(parse_embeddings_request(R"({"input":[1,2,3],"prompt_name":"query"})", d,
|
||||
f.limits(), &r, &e) < 0);
|
||||
}
|
||||
{
|
||||
OaiRequest r; ApiError e;
|
||||
CHECK_OK(parse_embeddings_request(R"({"input":"x","dimensions":256})", d, f.limits(), &r,
|
||||
&e));
|
||||
CHECK_EQ(r.dimensions, (int64_t)256);
|
||||
CHECK(parse_embeddings_request(R"({"input":"x","dimensions":0})", d, f.limits(), &r,
|
||||
&e) < 0);
|
||||
CHECK(parse_embeddings_request(R"({"input":"x","image_tokens":300})", d, f.limits(), &r,
|
||||
&e) < 0);
|
||||
}
|
||||
{
|
||||
OaiRequest r; ApiError e;
|
||||
CHECK_OK(parse_embeddings_request(
|
||||
R"({"messages":[{"role":"user","content":"hello"}]})", d, f.limits(), &r, &e));
|
||||
CHECK_EQ(r.prompts.size(), (size_t)1);
|
||||
CHECK(!r.prompts[0].tokens.empty());
|
||||
CHECK(parse_embeddings_request(
|
||||
R"({"input":"x","messages":[{"role":"user","content":"hello"}]})", d,
|
||||
f.limits(), &r, &e) < 0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(detokenize_answers_under_the_key_vllm_uses) {
|
||||
Fixture f;
|
||||
HttpResponse r = f.post("/detokenize", R"({"tokens":[65,66,67]})");
|
||||
|
||||
Reference in new issue
Block a user