Tonic commited on
Commit
b5f833c
Β·
verified Β·
1 Parent(s): 2da65b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -25,13 +25,12 @@ def last_token_pool(last_hidden_states: Tensor, attention_mask: Tensor) -> Tenso
25
  def get_detailed_instruct(task_description: str, query: str) -> str:
26
  return f'Instruct: {task_description}\nQuery: {query}'
27
 
28
- tokenizer = AutoTokenizer.from_pretrained('intfloat/e5-mistral-7b-instruct')
29
- model = AutoModel.from_pretrained('intfloat/e5-mistral-7b-instruct')
30
 
31
  @spaces.GPU
32
  def compute_embeddings(*input_texts):
 
 
33
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
34
-
35
  model.to(device)
36
  max_length = 4096
37
  task = 'Given a web search query, retrieve relevant passages that answer the query'
 
25
  def get_detailed_instruct(task_description: str, query: str) -> str:
26
  return f'Instruct: {task_description}\nQuery: {query}'
27
 
 
 
28
 
29
  @spaces.GPU
30
  def compute_embeddings(*input_texts):
31
+ tokenizer = AutoTokenizer.from_pretrained('intfloat/e5-mistral-7b-instruct')
32
+ model = AutoModel.from_pretrained('intfloat/e5-mistral-7b-instruct')
33
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
34
  model.to(device)
35
  max_length = 4096
36
  task = 'Given a web search query, retrieve relevant passages that answer the query'