Tonic commited on
Commit
d4e8fb9
1 Parent(s): 97173ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -97,7 +97,7 @@ class EmbeddingModel:
97
 
98
 
99
  def app_interface():
100
- # embedding_model = EmbeddingModel()
101
  with gr.Blocks() as demo:
102
  gr.Markdown(title)
103
  gr.Markdown(description)
@@ -109,7 +109,7 @@ def app_interface():
109
  compute_button = gr.Button("Try🐣🛌🏻e5")
110
  output_display = gr.Textbox(label="🐣e5-mistral🛌🏻 Embeddings")
111
  compute_button.click(
112
- fn=EmbeddingModel.compute_embeddings,
113
  inputs=[task_dropdown, input_text_box],
114
  outputs=output_display
115
  )
@@ -122,7 +122,7 @@ def app_interface():
122
  similarity_button = gr.Button("Compute Similarity")
123
  similarity_output = gr.Label(label="🐣e5-mistral🛌🏻 Similarity Scores")
124
  similarity_button.click(
125
- fn=EmbeddingModel.compute_similarity,
126
  inputs=[task_dropdown, sentence1_box, sentence2_box, extra_sentence1_box, extra_sentence2_box],
127
  outputs=similarity_output
128
  )
 
97
 
98
 
99
  def app_interface():
100
+ embedding_model = EmbeddingModel()
101
  with gr.Blocks() as demo:
102
  gr.Markdown(title)
103
  gr.Markdown(description)
 
109
  compute_button = gr.Button("Try🐣🛌🏻e5")
110
  output_display = gr.Textbox(label="🐣e5-mistral🛌🏻 Embeddings")
111
  compute_button.click(
112
+ fn=embedding_model.compute_embeddings,
113
  inputs=[task_dropdown, input_text_box],
114
  outputs=output_display
115
  )
 
122
  similarity_button = gr.Button("Compute Similarity")
123
  similarity_output = gr.Label(label="🐣e5-mistral🛌🏻 Similarity Scores")
124
  similarity_button.click(
125
+ fn=embedding_model.compute_similarity,
126
  inputs=[task_dropdown, sentence1_box, sentence2_box, extra_sentence1_box, extra_sentence2_box],
127
  outputs=similarity_output
128
  )