leadr64 commited on
Commit
fd190ad
·
1 Parent(s): 3a7a1b1

Ajouter le script Gradio et les dépendances

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -2,16 +2,13 @@ import os
2
  import gradio as gr
3
  from qdrant_client import QdrantClient
4
  from transformers import ClapModel, ClapProcessor
 
5
 
6
  # Retrieve Qdrant URL and API key from environment variables
7
- QDRANT_URL = os.getenv("QDRANT_URL")
8
- QDRANT_API_KEY = os.getenv("QDRANT_API_KEY")
9
-
10
- if not QDRANT_URL or not QDRANT_API_KEY:
11
- raise ValueError("Please set the QDRANT_URL and QDRANT_API_KEY environment variables")
12
 
13
  # Loading the Qdrant DB in local ###################################################################
14
- client = QdrantClient(QDRANT_URL, api_key=QDRANT_API_KEY)
15
  print("[INFO] Client created...")
16
 
17
  # loading the model
 
2
  import gradio as gr
3
  from qdrant_client import QdrantClient
4
  from transformers import ClapModel, ClapProcessor
5
+ import huggingface_hub
6
 
7
  # Retrieve Qdrant URL and API key from environment variables
8
+ secrets = huggingface_hub.get_secret()
9
+ client = QdrantClient(secrets["QDRANT_URL"], secrets["QDRANT_KEY"])
 
 
 
10
 
11
  # Loading the Qdrant DB in local ###################################################################
 
12
  print("[INFO] Client created...")
13
 
14
  # loading the model