Skip to content

Commit

Permalink
Merge pull request #380 from aatmanvaidya/update-fel
Browse files Browse the repository at this point in the history
Update Packages and Fix minor Issues
  • Loading branch information
aatmanvaidya committed Sep 12, 2024
2 parents 4abae4d + 08b3085 commit cf64f4d
Show file tree
Hide file tree
Showing 15 changed files with 1,089 additions and 981 deletions.
8 changes: 0 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/docs"
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "weekly"

# Enable version updates for Docker
- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
output: 'trivy-results.sarif'
limit-severities-for-sarif: true
severity: 'HIGH,CRITICAL'
scanners: 'vuln,config,secret'
scanners: 'vuln,misconfig,secret'
skip-dirs: '.vscode,docs'
exit-code: '1'
- name: Upload Trivy scan results to GitHub Security tab
Expand Down
2 changes: 1 addition & 1 deletion src/base_requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pip==24.0
pip==24.2
8 changes: 4 additions & 4 deletions src/base_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes base_requirements.in
#

# The following packages are considered to be unsafe in a requirements file:
pip==24.0 \
--hash=sha256:ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc \
--hash=sha256:ea9bd1a847e8c5774a5777bb398c19e80bcd4e2aa16a4b301b718fe6f593aba2
pip==24.2 \
--hash=sha256:2cd581cf58ab7fcfca4ce8efa6dcacd0de5bf8d0a3eb9ec927e07405f4d9e2a2 \
--hash=sha256:5b5e490b5e9cb275c879595064adce9ebd31b854e3e803740b72f9ccf34a45b8
# via -r base_requirements.in
11 changes: 8 additions & 3 deletions src/core/operators/audio_vec_embedding_requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
numpy==1.26.4
librosa==0.10.2.post1
panns-inference==0.1.1
torch==2.2.0+cpu
memray==1.12.0
pyinstrument==4.6.2
# torch==2.2.0+cpu
torch==2.4.1
memray==1.14.0
pyinstrument==4.7.3
# not direct requirments, but added because of pip-audit report
certifi==2024.7.4
urllib3==2.2.2
scikit-learn==1.5.0
404 changes: 232 additions & 172 deletions src/core/operators/audio_vec_embedding_requirements.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/operators/test_classify_video_zero_shot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def tearDownClass(cls):
# delete config files
pass

# @skip
@skip
def test_sample_video_from_disk(self):
video_path = VideoFactory.make_from_file_on_disk(
r"core/operators/sample_data/sample-cat-video.mp4"
Expand Down
2 changes: 1 addition & 1 deletion src/core/operators/test_vid_vec_rep_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def tearDownClass(cls):
# delete config files
pass

# @skip
@skip
def test_sample_video_from_disk(self):
video_path = VideoFactory.make_from_file_on_disk(
r"core/operators/sample_data/sample-cat-video.mp4"
Expand Down
20 changes: 12 additions & 8 deletions src/core/operators/vid_vec_rep_resnet_requirements.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
torch==2.2.0+cpu
torchvision==0.17.0+cpu
numpy==1.26.4
Pillow==10.3.0
scipy==1.11.4
opencv-python-headless==4.9.0.80
memray==1.12.0
pyinstrument==4.6.2
# torch==2.2.0+cpu
# torchvision==0.17.0+cpu
numpy==2.1.1
torch==2.4.1
Pillow==10.4.0
scipy==1.14.1
opencv-python-headless==4.10.0.84
memray==1.14.0
pyinstrument==4.7.3
# not direct requirments, but added because of pip-audit report
certifi==2024.7.4
urllib3==2.2.2
774 changes: 381 additions & 393 deletions src/core/operators/vid_vec_rep_resnet_requirements.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/store/es_vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def refresh(self):
self.client.indices.refresh()

def find(self, index_name, vec):
if type(vec) == np.ndarray:
if isinstance(vec, np.ndarray):
vec = vec.tolist()

calculation = ""
Expand Down
29 changes: 16 additions & 13 deletions src/requirements.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
flask==3.0.3
Flask-Cors==4.0.1
Pillow==10.3.0
elasticsearch==8.11.1
Flask-Cors==5.0.0
Pillow==10.4.0
elasticsearch==8.15.1
wget==3.2
pika==1.3.2
python-dotenv==1.0.0
python-dotenv==1.0.1
click==8.1.7
pytest==7.4.4
PyYAML==6.0.1
pytest==8.3.3
PyYAML==6.0.2
dacite==1.8.1
memray==1.12.0 # dev
pyinstrument==4.6.2
numpy==1.26.4
memray==1.14.0 # dev
pyinstrument==4.7.3
numpy==2.1.1
requests==2.32.2
locust==2.27.0
nose2==0.14.1
locust==2.31.5
nose2==0.15.1
psycopg2-binary==2.9.9
boto3==1.34.64
pydub==0.25.1
boto3==1.35.16
pydub==0.25.1
# not direct requirments, but added because of pip-audit report
certifi==2024.7.4
urllib3==2.2.2
771 changes: 411 additions & 360 deletions src/requirements.txt

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions src/tests/core/store/test_es_vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
from requests.exceptions import ConnectTimeout
from core.store.es_vec import ES
from core.config import StoreConfig, StoreParameters
from core.config import StoreConfig, StoreEntity, StoreESParameters
from core.models.media import MediaType
import pprint
from datetime import datetime
Expand Down Expand Up @@ -33,15 +33,19 @@ def setUpClass(cls) -> None:
"audio_index_name": "test_audio",
}
cls.param = StoreConfig(
label="test",
type="es",
parameters=StoreParameters(
host_name=param_dict["host_name"],
image_index_name=param_dict["image_index_name"],
text_index_name=param_dict["text_index_name"],
video_index_name=param_dict["video_index_name"],
audio_index_name=param_dict["audio_index_name"],
),
entities=[
StoreEntity(
label="test",
type="es",
parameters=StoreESParameters(
host_name=param_dict["host_name"],
image_index_name=param_dict["image_index_name"],
text_index_name=param_dict["text_index_name"],
video_index_name=param_dict["video_index_name"],
audio_index_name=param_dict["audio_index_name"],
),
)
]
)
except ConnectTimeout:
print('Request has timed out')
Expand All @@ -56,8 +60,8 @@ def tearDownClass(cls) -> None:

# @skip
def test_create_indices(self):
print(self.param)
es = ES(self.param)
print(self.param.entities[0])
es = ES(self.param.entities[0])
es.connect()
es.optionally_create_index()
indices = es.get_indices()
Expand Down Expand Up @@ -96,7 +100,7 @@ def test_store_image(self):

# @skip
def test_store_and_search_vectors(self):
es = ES(self.param)
es = ES(self.param.entities[0])
es.connect()
es.optionally_create_index()
vec = np.random.randn(512).tolist()
Expand Down Expand Up @@ -133,7 +137,7 @@ def test_find_by_metadata_field(self):

def delete_indices(self):
print("DELETING INDICES")
es = ES(self.param)
es = ES(self.param.entities[0])
es.connect()
es.delete_indices()
print("INDICES DELETED")
Expand Down
3 changes: 2 additions & 1 deletion src/worker/clustering_media/clustering_media_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from core.operators import audio_vec_embedding_clap
from core.operators import vid_vec_rep_clip, classify_video_zero_shot
from core.operators import cluster_embeddings, dimension_reduction
import requests, json
import requests
import json
from core.models.media_factory import AudioFactory, VideoFactory
from time import sleep

Expand Down

0 comments on commit cf64f4d

Please sign in to comment.