@@ -550,6 +550,39 @@ export const keras_hub = (model: ModelData): string[] => {
550550	return  snippets ; 
551551} ; 
552552
553+ export  const  lightning_ir  =  ( model : ModelData ) : string [ ]  =>  { 
554+ 	if  ( model . tags . includes ( "bi-encoder" ) )  { 
555+ 		return  [ 
556+ 			`#install from https://github.com/webis-de/lightning-ir 
557+ 
558+ from lightning_ir import BiEncoderModule 
559+ model = BiEncoderModule("${ model . id }  
560+ 
561+ model.score("query", ["doc1", "doc2", "doc3"])` , 
562+ 		] ; 
563+ 	}  else  if  ( model . tags . includes ( "cross-encoder" ) )  { 
564+ 		return  [ 
565+ 			`#install from https://github.com/webis-de/lightning-ir 
566+ 
567+ from lightning_ir import CrossEncoderModule 
568+ model = CrossEncoderModule("${ model . id }  
569+ 
570+ model.score("query", ["doc1", "doc2", "doc3"])` , 
571+ 		] ; 
572+ 	} 
573+ 	return  [ 
574+ 		`#install from https://github.com/webis-de/lightning-ir 
575+ 
576+ from lightning_ir import BiEncoderModule, CrossEncoderModule 
577+ 
578+ # depending on the model type, use either BiEncoderModule or CrossEncoderModule 
579+ model = BiEncoderModule("${ model . id }  
580+ # model = CrossEncoderModule("${ model . id }  
581+ 
582+ model.score("query", ["doc1", "doc2", "doc3"])` , 
583+ 	] ; 
584+ } ; 
585+ 
553586export  const  llama_cpp_python  =  ( model : ModelData ) : string [ ]  =>  { 
554587	const  snippets  =  [ 
555588		`from llama_cpp import Llama 
0 commit comments