sksameermujahid commited on
Commit
1eeb3c8
·
verified ·
1 Parent(s): d200173

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -60,13 +60,13 @@ conversation_context = {}
60
  def load_sentence_transformer():
61
  print("Loading SentenceTransformer model...")
62
  try:
63
- # First download the model
64
- model_path = snapshot_download(
65
- repo_id="jinaai/jina-embeddings-v3",
 
 
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.")