m7n commited on
Commit
68c2c3b
·
1 Parent(s): 0807cf5

switched decorator to main function

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -109,11 +109,12 @@ def no_op_decorator(func):
109
  decorator_to_use = spaces.GPU() if is_running_in_hf_space() else no_op_decorator
110
  #duration=120
111
 
112
- @decorator_to_use
113
  def create_embeddings(texts_to_embedd):
114
  """Create embeddings for the input texts using the loaded model."""
115
  return model.encode(texts_to_embedd, show_progress_bar=True, batch_size=192)
116
 
 
 
117
  def predict(text_input, sample_size_slider, reduce_sample_checkbox, sample_reduction_method,
118
  plot_time_checkbox, locally_approximate_publication_date_checkbox,
119
  download_csv_checkbox, download_png_checkbox,citation_graph_checkbox, progress=gr.Progress()):
 
109
  decorator_to_use = spaces.GPU() if is_running_in_hf_space() else no_op_decorator
110
  #duration=120
111
 
 
112
  def create_embeddings(texts_to_embedd):
113
  """Create embeddings for the input texts using the loaded model."""
114
  return model.encode(texts_to_embedd, show_progress_bar=True, batch_size=192)
115
 
116
+
117
+ @decorator_to_use
118
  def predict(text_input, sample_size_slider, reduce_sample_checkbox, sample_reduction_method,
119
  plot_time_checkbox, locally_approximate_publication_date_checkbox,
120
  download_csv_checkbox, download_png_checkbox,citation_graph_checkbox, progress=gr.Progress()):