m7n commited on
Commit
4419e34
·
verified ·
1 Parent(s): 3a03f47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -88,7 +88,7 @@ tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_aug2023refresh_base'
88
  model = AutoAdapterModel.from_pretrained('allenai/specter2_aug2023refresh_base')
89
 
90
 
91
-
92
  def create_embeddings(texts_to_embedd):
93
  # Set up the device
94
 
@@ -106,7 +106,7 @@ def create_embeddings(texts_to_embedd):
106
  for i in range(0, len(data), batch_size):
107
  yield data[i:i + batch_size]
108
 
109
- @spaces.GPU(duration=120)
110
  def encode_texts(texts, device, batch_size=16):
111
  """Process texts in batches and return their embeddings."""
112
  model.eval()
 
88
  model = AutoAdapterModel.from_pretrained('allenai/specter2_aug2023refresh_base')
89
 
90
 
91
+ @spaces.GPU(duration=120)
92
  def create_embeddings(texts_to_embedd):
93
  # Set up the device
94
 
 
106
  for i in range(0, len(data), batch_size):
107
  yield data[i:i + batch_size]
108
 
109
+
110
  def encode_texts(texts, device, batch_size=16):
111
  """Process texts in batches and return their embeddings."""
112
  model.eval()