Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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'
|