EmicoBinsfinder commited on
Commit
f27c318
·
1 Parent(s): 1423dfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -6
app.py CHANGED
@@ -55,12 +55,6 @@ def broad_scope_class_predictor(class_embeddings, abstract_embedding, N=5, Sensi
55
  HighestSimilarity = predictions.nlargest(N, ['Score'])
56
 
57
  def sentence_embedder(sentences, model_path):
58
- """
59
- Calling the sentence similarity model to generate embeddings on input text.
60
- :param sentences: takes input text in the form of a string
61
- :param model_path: path to the text similarity model
62
- :return returns a (1, 384) embedding of the input text
63
- """
64
  tokenizer = AutoTokenizer.from_pretrained(model_path) #instantiating the sentence embedder using HuggingFace library
65
  model = AutoModel.from_pretrained(model_path, from_tf=True) #making a model instance
66
  encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
 
55
  HighestSimilarity = predictions.nlargest(N, ['Score'])
56
 
57
  def sentence_embedder(sentences, model_path):
 
 
 
 
 
 
58
  tokenizer = AutoTokenizer.from_pretrained(model_path) #instantiating the sentence embedder using HuggingFace library
59
  model = AutoModel.from_pretrained(model_path, from_tf=True) #making a model instance
60
  encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')