berkaygkv commited on
Commit
edb622a
1 Parent(s): d60ee06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -31,7 +31,11 @@ def load_resources():
31
 
32
  @st.cache_resource
33
  def get_qdrant_client():
34
- client = QdrantClient(url=QDRANT_HOST)
 
 
 
 
35
  try:
36
  client.get_collection(COLLECTION_NAME)
37
  except Exception:
@@ -44,8 +48,7 @@ def get_spotify_client():
44
  client_secret=SPOTIPY_CLIENT_SECRET,
45
  redirect_uri=SPOTIPY_REDIRECT_URI,
46
  scope=SCOPE,
47
- cache_path=None,
48
- open_browser=False
49
  )
50
 
51
  if 'code' in st.experimental_get_query_params():
 
31
 
32
  @st.cache_resource
33
  def get_qdrant_client():
34
+ client = QdrantClient(path="./qdrant_data")
35
+ try:
36
+ client.create_collection(COLLECTION_NAME, vectors_config=models.VectorParams(size=512, distance=models.Distance.COSINE),)
37
+ except Exception:
38
+ pass
39
  try:
40
  client.get_collection(COLLECTION_NAME)
41
  except Exception:
 
48
  client_secret=SPOTIPY_CLIENT_SECRET,
49
  redirect_uri=SPOTIPY_REDIRECT_URI,
50
  scope=SCOPE,
51
+ cache_path=CACHE_PATH
 
52
  )
53
 
54
  if 'code' in st.experimental_get_query_params():