Zeitstaub commited on
Commit
4073415
1 Parent(s): c8f7b33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -25,6 +25,11 @@ model_options = {
25
 
26
  # Main function for the Gradio interface
27
  def find_similar_texts(model_name, input_text):
 
 
 
 
 
28
  # Check whether there are abstracts matching the text input
29
  input_embedding_mini = model_all_Mini.encode(input_text).reshape(1, -1)
30
  embedding_matrix_mini = np.vstack(text_embeddings['embedding_all-MiniLM-L6-v2'])
 
25
 
26
  # Main function for the Gradio interface
27
  def find_similar_texts(model_name, input_text):
28
+
29
+ # Check whether model has been selected
30
+ if not model_name:
31
+ return "You forgot to choose a sentence-transformer."
32
+
33
  # Check whether there are abstracts matching the text input
34
  input_embedding_mini = model_all_Mini.encode(input_text).reshape(1, -1)
35
  embedding_matrix_mini = np.vstack(text_embeddings['embedding_all-MiniLM-L6-v2'])