File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1364,6 +1364,28 @@ function get_widget_examples_from_st_model(model: ModelData): string[] | undefin
13641364
13651365export const sentenceTransformers = ( model : ModelData ) : string [ ] => {
13661366 const remote_code_snippet = model . tags . includes ( TAG_CUSTOM_CODE ) ? ", trust_remote_code=True" : "" ;
1367+
1368+ if ( model . tags . includes ( "PyLate" ) ) {
1369+ return [
1370+ `from pylate import models
1371+
1372+ queries = [
1373+ "Which planet is known as the Red Planet?",
1374+ "What is the largest planet in our solar system?",
1375+ ]
1376+
1377+ documents = [
1378+ ["Mars is the Red Planet.", "Venus is Earth's twin."],
1379+ ["Jupiter is the largest planet.", "Saturn has rings."],
1380+ ]
1381+
1382+ model = models.ColBERT(model_name_or_path="${ model . id } ")
1383+
1384+ queries_emb = model.encode(queries, is_query=True)
1385+ docs_emb = model.encode(documents, is_query=False)` ,
1386+ ] ;
1387+ }
1388+
13671389 if ( model . tags . includes ( "cross-encoder" ) || model . pipeline_tag == "text-ranking" ) {
13681390 return [
13691391 `from sentence_transformers import CrossEncoder
You can’t perform that action at this time.
0 commit comments