Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,13 +60,13 @@ conversation_context = {}
|
|
60 |
def load_sentence_transformer():
|
61 |
print("Loading SentenceTransformer model...")
|
62 |
try:
|
63 |
-
#
|
64 |
-
|
65 |
-
|
|
|
|
|
66 |
trust_remote_code=True
|
67 |
)
|
68 |
-
# Then load it with SentenceTransformer
|
69 |
-
model_embedding = SentenceTransformer(model_path).to(device)
|
70 |
|
71 |
if not os.path.exists(MODEL_PATH):
|
72 |
raise FileNotFoundError(f"Model state dict not found at {MODEL_PATH}. Please ensure the file exists.")
|
|
|
60 |
def load_sentence_transformer():
|
61 |
print("Loading SentenceTransformer model...")
|
62 |
try:
|
63 |
+
# Load the model directly with trust_remote_code
|
64 |
+
from sentence_transformers import SentenceTransformer
|
65 |
+
model_embedding = SentenceTransformer(
|
66 |
+
'jinaai/jina-embeddings-v3',
|
67 |
+
device=device,
|
68 |
trust_remote_code=True
|
69 |
)
|
|
|
|
|
70 |
|
71 |
if not os.path.exists(MODEL_PATH):
|
72 |
raise FileNotFoundError(f"Model state dict not found at {MODEL_PATH}. Please ensure the file exists.")
|