Anja97 commited on
Commit
c0cb3c3
·
1 Parent(s): 5d65c37

changes in api

Browse files
Files changed (1) hide show
  1. api.py +0 -3
api.py CHANGED
@@ -19,7 +19,6 @@ class QueryResponse(BaseModel):
19
  # Initialize FastAPI app
20
  app = FastAPI()
21
 
22
- # Global variable to store the search engine
23
  search_engine = None
24
 
25
  # Load prompts and initialize the search engine when the app starts
@@ -29,8 +28,6 @@ def startup_event():
29
  # Load the prompts
30
  dataset = load_dataset("Gustavosta/Stable-Diffusion-Prompts")
31
  prompts = dataset["train"]["Prompt"]
32
- # For testing, limit the number of prompts
33
- prompts = prompts[:1000] # Adjust the number as needed
34
  # Initialize vectorizer with the default model
35
  vectorizer = Vectorizer(model="all-MiniLM-L6-v2")
36
  # Initialize the search engine
 
19
  # Initialize FastAPI app
20
  app = FastAPI()
21
 
 
22
  search_engine = None
23
 
24
  # Load prompts and initialize the search engine when the app starts
 
28
  # Load the prompts
29
  dataset = load_dataset("Gustavosta/Stable-Diffusion-Prompts")
30
  prompts = dataset["train"]["Prompt"]
 
 
31
  # Initialize vectorizer with the default model
32
  vectorizer = Vectorizer(model="all-MiniLM-L6-v2")
33
  # Initialize the search engine