Ajouter le script Gradio et les dépendances
Browse files
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 |
-
|
| 8 |
-
|
| 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
|