Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23189

the documented example of vespa is not working

$
0
0

I'm trying to replicate one of the documented examples. But it is not working at all.Kind of weird as the documented example is throwing off these Error.

the issue is at max_simRuntimeError: Deployment failed, code: 400, message: {'error-code': 'INVALID_APPLICATION_PACKAGE', 'message': "Invalid application: In schema 'testapp', rank profile 'combined_ranking': The function 'context_max_sim' is invalid: max_sim is invalid: Can not join tensor(qt{},x[128]) and tensor(context{},dt{},x[16]): Unequal dimension x in tensor(qt{},x[128]) and tensor(context{},dt{},x[16])"}

Field(                name="colbert",                type="tensor<int8>(context{}, dt{}, x[16])",                indexing=["attribute", "summary"],                # attribute=["paged"],                # is_document_field=False,            ),Ranking:-RankProfile(                name="hybrid_ranking",                first_phase="cos_sim",                second_phase=SecondPhaseRanking(                    expression="context_max_sim", rerank_count=20                ),                global_phase=GlobalPhaseRanking(                    expression="cos_sim * 0.15 + context_max_sim * 0.85",                    rerank_count=10                ),                functions=[                    Function(                        name="unpack", expression="cell_cast(attribute(colbert), float)"                    ),                    Function(                        name="cos_sim",                        expression="cosine_similarity(query(query_embedding), attribute(embedding),x)",                    ),                    Function(                        name="context_max_sim",                        expression="reduce(max_sim, max, context)",                    ),                    Function(                        name="max_sim",                        expression="""sum(    reduce(        sum(            query(qt) * unpack_bits(attribute(colbert)), x        ),        max, dt    ),    qt)/32.0""",                    ),                ],                inputs=[                    ("query(query_embedding)", "tensor<float>(x[1024])"),                    ("query(qt)", "tensor<float>(qt{}, x[128])")                ],                match_features=["context_max_sim", "cos_sim", "bm25(text)", "max_sim"],            )        )```

Viewing all articles
Browse latest Browse all 23189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>