tharu22 commited on
Commit
b73a849
·
1 Parent(s): 1295d73
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -2,6 +2,7 @@ from fastapi import FastAPI, HTTPException
2
  from pydantic import BaseModel
3
  from sentence_transformers import SentenceTransformer
4
  import numpy as np
 
5
  from huggingface_hub import HfApi, HfFolder, Repository, hf_hub_url, cached_download
6
 
7
  # Initialize the FastAPI app
@@ -9,7 +10,7 @@ app = FastAPI()
9
 
10
  # Load the pre-trained SentenceTransformer model from Hugging Face
11
  #model = SentenceTransformer("//huggingface.co/spaces/Kabila22/Kabilan_embedding_1", trust_remote_code=True)
12
- model = SentenceTransformer("Alibaba-NLP/gte-base-en-v1.5", trust_remote_code=True)
13
 
14
  # Define the request body schema
15
  class TextInput(BaseModel):
 
2
  from pydantic import BaseModel
3
  from sentence_transformers import SentenceTransformer
4
  import numpy as np
5
+ from huggingface_hub import hf_hub_download
6
  from huggingface_hub import HfApi, HfFolder, Repository, hf_hub_url, cached_download
7
 
8
  # Initialize the FastAPI app
 
10
 
11
  # Load the pre-trained SentenceTransformer model from Hugging Face
12
  #model = SentenceTransformer("//huggingface.co/spaces/Kabila22/Kabilan_embedding_1", trust_remote_code=True)
13
+ model = hf_hub_download("Alibaba-NLP/gte-base-en-v1.5", trust_remote_code=True)
14
 
15
  # Define the request body schema
16
  class TextInput(BaseModel):