Spaces:
Sleeping
Sleeping
Vela
commited on
Commit
Β·
60ac74d
1
Parent(s):
5780451
added .env
Browse files
.gitignore
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
|
| 2 |
.venv
|
| 3 |
logs
|
|
|
|
| 1 |
+
.env
|
| 2 |
.venv
|
| 3 |
logs
|
src/app/__pycache__/homepage.cpython-313.pyc
CHANGED
|
Binary files a/src/app/__pycache__/homepage.cpython-313.pyc and b/src/app/__pycache__/homepage.cpython-313.pyc differ
|
|
|
src/app/homepage.py
CHANGED
|
@@ -39,7 +39,7 @@ def search_tab():
|
|
| 39 |
|
| 40 |
with st.container():
|
| 41 |
|
| 42 |
-
col1, col2 = st.columns([7,
|
| 43 |
with col1:
|
| 44 |
search_query = st.text_input(
|
| 45 |
label="π Search for Images",
|
|
|
|
| 39 |
|
| 40 |
with st.container():
|
| 41 |
|
| 42 |
+
col1, col2 = st.columns([7, 5], gap="small")
|
| 43 |
with col1:
|
| 44 |
search_query = st.text_input(
|
| 45 |
label="π Search for Images",
|
src/config/__pycache__/config.cpython-313.pyc
DELETED
|
Binary file (1.09 kB)
|
|
|
src/config/config.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
import yaml
|
| 2 |
-
from utils import logger
|
| 3 |
-
|
| 4 |
-
logger = logger.get_logger()
|
| 5 |
-
|
| 6 |
-
def load_config():
|
| 7 |
-
try:
|
| 8 |
-
with open('config.yaml', 'r') as file:
|
| 9 |
-
config_data = yaml.load(file, Loader=yaml.FullLoader)
|
| 10 |
-
logger.info("Successfully loaded the config.")
|
| 11 |
-
return config_data
|
| 12 |
-
except Exception as e:
|
| 13 |
-
logger.error(f"Unexpected error occurred while loading the config: {e}")
|
| 14 |
-
raise Exception(f"Error loading configuration: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/database_pinecone/__pycache__/create_database.cpython-313.pyc
CHANGED
|
Binary files a/src/database_pinecone/__pycache__/create_database.cpython-313.pyc and b/src/database_pinecone/__pycache__/create_database.cpython-313.pyc differ
|
|
|
src/database_pinecone/create_database.py
CHANGED
|
@@ -5,11 +5,12 @@ sys.path.append(src_directory)
|
|
| 5 |
from pinecone import Pinecone, ServerlessSpec
|
| 6 |
import time
|
| 7 |
from model.clip_model import ClipModel
|
| 8 |
-
from
|
| 9 |
from utils import logger
|
| 10 |
import pandas as pd
|
| 11 |
|
| 12 |
-
|
|
|
|
| 13 |
logger = logger.get_logger()
|
| 14 |
|
| 15 |
clip_model = ClipModel()
|
|
@@ -38,7 +39,6 @@ def wait_till_index_loaded(pinecone, index_name):
|
|
| 38 |
|
| 39 |
def get_index():
|
| 40 |
try:
|
| 41 |
-
pincone_api_key = config['pinecone_db']['pincone_api_key']
|
| 42 |
pc = Pinecone(api_key=pincone_api_key)
|
| 43 |
index = None
|
| 44 |
index_name = "imagesearch"
|
|
|
|
| 5 |
from pinecone import Pinecone, ServerlessSpec
|
| 6 |
import time
|
| 7 |
from model.clip_model import ClipModel
|
| 8 |
+
from dotenv import load_dotenv
|
| 9 |
from utils import logger
|
| 10 |
import pandas as pd
|
| 11 |
|
| 12 |
+
load_dotenv()
|
| 13 |
+
pincone_api_key = os.environ.get("PINECONE_API_KEY")
|
| 14 |
logger = logger.get_logger()
|
| 15 |
|
| 16 |
clip_model = ClipModel()
|
|
|
|
| 39 |
|
| 40 |
def get_index():
|
| 41 |
try:
|
|
|
|
| 42 |
pc = Pinecone(api_key=pincone_api_key)
|
| 43 |
index = None
|
| 44 |
index_name = "imagesearch"
|