You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bumblebee did not yet implement the architecture :for_sequence_classification.
efmoduleRAG.CrossEncoderdodefload_modeldorepo={:hf,"cross-encoder/ms-marco-MiniLM-L-6-v2"}tokenizer={:hf,"bert-base-uncased"}{:ok,model_info}=Bumblebee.load_model(repo){:ok,tokenizer}=Bumblebee.load_tokenizer(tokenizer){model_info,tokenizer}enddefrerank(query,documents)do# Prepare input pairs for cross-encoder{model_info,tokenizer}=load_model()input_pairs=Bumblebee.apply_tokenizer(tokenizer,Enum.map(documents,fndoc->{query,doc.content}end))# Run cross-encoder in batchesoutputs=Axon.predict(model_info.model,model_info.params,input_pairs)# Combine scores with original documents and sortEnum.zip(documents,outputs.logits|>Nx.to_flat_list())|>Enum.sort_by(fn{_,score}->scoreend,:desc)|>Enum.map(fn{doc,_}->doc.contentend)endend
# Load the modelcross_encoder_serving=RAG.CrossEncoder.load_model()# Rerank the results obtained from the HSWN (first creaming step)reranked_results=RAG.CrossEncoder.rerank(query,top_results,cross_encoder_serving)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
elixir-nx/bumblebee#251
Bumblebee did not yet implement the architecture
:for_sequence_classification
.Beta Was this translation helpful? Give feedback.
All reactions