Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding comments #457

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Version Bump Test

permissions:
contents: write

on:
push:
branches:
- test1

jobs:
version_bump:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Setup Python version
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'

- name: Install semantic-release
run: |
pip install python-semantic-release

- name: Dry Run - Version Bump for Main Project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd feluda
semantic-release version --dry-run

- name: Dry Run - Version Bump for Operator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd operators/image_vec_rep_resnet
semantic-release version --dry-run
152 changes: 152 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,158 @@



## v0.8.0 (2024-09-12)

### Chore

* chore: updating vid vec rep resenet packages ([`9f212c2`](https://github.com/tattle-made/feluda/commit/9f212c2d21cb7ad33a41330f203dab3d41f04d69))

* chore: updating audio vec embedding pacakges ([`a41f996`](https://github.com/tattle-made/feluda/commit/a41f996f40af1b5f9c70786ee376c6a5f2348b32))

* chore: updating audio vec embedding pacakges ([`6e50e06`](https://github.com/tattle-made/feluda/commit/6e50e0683702cc9549773ab6bffa742a43105835))

* chore: fix conflict in updating requirements packages ([`acf1a56`](https://github.com/tattle-made/feluda/commit/acf1a564d872c26575f0d23abe5a7a7b56df8c94))

* chore: updating requirements packages ([`5390073`](https://github.com/tattle-made/feluda/commit/5390073e3a848e0984ef6049d1500991d27583aa))

* chore: fix ruff lint warnings ([`5f73898`](https://github.com/tattle-made/feluda/commit/5f738980d18eb9572d61b26aaf7a6f23ac016aaa))

* chore: add error handling to clustering and reduction operations ([`ba01287`](https://github.com/tattle-made/feluda/commit/ba01287cd7cbb175b516874fcc489e5b0261ebc7))

* chore: hardcode perplexity value for t-SNE ([`60315b5`](https://github.com/tattle-made/feluda/commit/60315b5fe96e445831c8c84641b8eb95f2d0e701))

* chore: change operator name to be more verbose

Signed-off-by: Snehil Shah <[email protected]> ([`45bef72`](https://github.com/tattle-made/feluda/commit/45bef72d74617bff5915429e3802fc88b9ed595a))

* chore: remove obsolete `print` statement

Signed-off-by: Snehil Shah <[email protected]> ([`92d02e2`](https://github.com/tattle-made/feluda/commit/92d02e219ecb0844de261b35fa2801adca139f04))

* chore: remove the file after the operation has ended

Signed-off-by: Snehil Shah <[email protected]> ([`4a384f5`](https://github.com/tattle-made/feluda/commit/4a384f57b6f4daa41861162898415fa981dc73e0))

* chore: removing docs gatsby website ([`03f5ac0`](https://github.com/tattle-made/feluda/commit/03f5ac078952851fdf17954484f34eccd066ca72))

### Ci

* ci: fix trivy github action ([`a5d4df8`](https://github.com/tattle-made/feluda/commit/a5d4df8d2e5f0b9b1654134557509df0a45c4583))

* ci: update dependabot yml file ([`8a6b007`](https://github.com/tattle-made/feluda/commit/8a6b007235c957e76e369bc3d2346a45f50aa337))

### Feature

* feat: add config

Signed-off-by: Snehil Shah <[email protected]> ([`73731ec`](https://github.com/tattle-made/feluda/commit/73731eceaad6e33c78052654012b1927e3682e5d))

* feat: add dimensionality reduction operator ([`2caf4a4`](https://github.com/tattle-made/feluda/commit/2caf4a4398383ae95731ce167c3d7d5391a49284))

* feat: improve exception handling and logic

Co-authored-by: Chaithanya512 <[email protected]>
Signed-off-by: Snehil Shah <[email protected]> ([`5756a59`](https://github.com/tattle-made/feluda/commit/5756a59d2a8f2e7395ff566f07213fbb6bb75bcd))

* feat: add `cluster_embeddings` operator

Signed-off-by: Snehil Shah <[email protected]> ([`4e08e35`](https://github.com/tattle-made/feluda/commit/4e08e35309c415b1bae0f65732d9df635da342a4))

* feat: add audio embedding operator using CLAP model ([`233cfd4`](https://github.com/tattle-made/feluda/commit/233cfd4065f2e43d6cf533ade3002270f02f5eb2))

* feat: add `classify_video` operator

Signed-off-by: Snehil Shah <[email protected]> ([`2001dab`](https://github.com/tattle-made/feluda/commit/2001dab2f38b0892b31cb269d85a118d16c0210f))

* feat: add `vid_vec_rep_clip` operator

Signed-off-by: Snehil Shah <[email protected]> ([`8874ce5`](https://github.com/tattle-made/feluda/commit/8874ce58d5ee77df7844c6b49ae5180736fee00e))

### Fix

* fix: es_vec test ([`08b3085`](https://github.com/tattle-made/feluda/commit/08b308587029507136cdc4fe68719a1357b84917))

* fix: enable worker support for dimension reductionn ([`89df059`](https://github.com/tattle-made/feluda/commit/89df059b251cd2ed7cddb46e39d60fe2d8b45e48))

* fix: update logic as per clustering spec

Signed-off-by: Snehil Shah <[email protected]> ([`0bea260`](https://github.com/tattle-made/feluda/commit/0bea260224c49cb6c2e0f0a47832789ff8b6591b))

* fix: correct indentation logic ([`d208d17`](https://github.com/tattle-made/feluda/commit/d208d17ba7f2c2914ca3666f1b25295d50524eab))

* fix: correct naming and add dimension reduction requirements ([`0334a4b`](https://github.com/tattle-made/feluda/commit/0334a4b20a5555c8278ba8fc99c55327c0c27b8b))

### Refactor

* refactor: migrate CLAP operator to Hugging Face Transformers ([`9e5195a`](https://github.com/tattle-made/feluda/commit/9e5195aa8ddf2c86d54333ee6e9c01a5576b32f4))

* refactor: align dimension reduction with feluda interface ([`0acfdb7`](https://github.com/tattle-made/feluda/commit/0acfdb74befae505f20ebf112bb3a58b087ca980))

* refactor: change modality to `video`

Signed-off-by: Snehil Shah <[email protected]> ([`a1506ba`](https://github.com/tattle-made/feluda/commit/a1506ba879444458f09f286d34baec94b38c3744))

### Style

* style: prepend newline for clearer output in logs

Signed-off-by: Snehil Shah <[email protected]> ([`bacafdd`](https://github.com/tattle-made/feluda/commit/bacafdd95142078626e1b996258859f13bbf8d97))

### Test

* test: add payload writer for the worker

Signed-off-by: Snehil Shah <[email protected]> ([`57803e0`](https://github.com/tattle-made/feluda/commit/57803e07451e8263544cc8d239f2e95a99c303e0))

### Unknown

* Merge pull request #381 from tattle-made/development

merge dev to main ([`48bfc87`](https://github.com/tattle-made/feluda/commit/48bfc87b813f5a34ea59c7bc9e7d7316000ce1ee))

* Merge pull request #380 from aatmanvaidya/update-fel

Update Packages and Fix minor Issues ([`cf64f4d`](https://github.com/tattle-made/feluda/commit/cf64f4d5ead811883d5012656222a3459cae4f09))

* Merge pull request #379 from Snehil-Shah/worker

worker for clustering media ([`4abae4d`](https://github.com/tattle-made/feluda/commit/4abae4dff4cd0d50c20eeb152c5a7220d2385923))

* nit: add logs

Signed-off-by: Snehil Shah <[email protected]> ([`1ba6de1`](https://github.com/tattle-made/feluda/commit/1ba6de164563dd086ab4797586a44c62770d8dd1))

* draft: implement initial clustering worker ([`7129ac3`](https://github.com/tattle-made/feluda/commit/7129ac3ee76993bd97eb10ac2df6ff703da86dcb))

* init: add Dockerfile for worker

Signed-off-by: Snehil Shah <[email protected]> ([`777994b`](https://github.com/tattle-made/feluda/commit/777994b597b1554a7bbfb77dd3eed8967a3757a5))

* Merge pull request #375 from Snehil-Shah/clustering

[81] - add operator to cluster embeddings ([`1da1c27`](https://github.com/tattle-made/feluda/commit/1da1c275fe840327c88623ef8d6b968338ebfc89))

* Merge pull request #376 from Chaithanya512/dim-reduction-operator

feat: add dimensionality reduction operator ([`cb76d85`](https://github.com/tattle-made/feluda/commit/cb76d85c0cb1e32295b0cf1e39d765bf4b1efb0b))

* Merge pull request #372 from Chaithanya512/audio_vec_emb_clap

feat: audio embedding operator using CLAP model ([`faa9727`](https://github.com/tattle-made/feluda/commit/faa9727eec8c4639ea61615c69c006384dbb5665))

* Merge pull request #370 from Snehil-Shah/classify-video

[81] - add operator to classify videos using a zero-shot approach ([`91f604b`](https://github.com/tattle-made/feluda/commit/91f604b5e04e109645c0e55f1c691ddd7d9fb681))

* Merge pull request #369 from Snehil-Shah/vid_vec_rep_clip

[81] - add operator to encode videos into vector embeddings using `CLIP-ViT-B-32` ([`c5f09de`](https://github.com/tattle-made/feluda/commit/c5f09de7dba47eed1ef8efe4eae1cf5d7c16def5))

* Merge pull request #367 from aatmanvaidya/remove-docs

chore: removing docs gatsby website ([`2b9275a`](https://github.com/tattle-made/feluda/commit/2b9275a134677a1338dfbd5f7c9fcd9922c7b447))


## v0.7.2 (2024-05-28)

### Fix
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ services:
ports:
- 7000:7000
- 5678:5678
- 8888:8888
command: tail -f /dev/null
depends_on:
store:
Expand Down Expand Up @@ -105,3 +106,4 @@ volumes:
# default:
# external: true
# name: kosh-v2_tattle

1 change: 1 addition & 0 deletions feluda/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .feluda import Feluda
95 changes: 95 additions & 0 deletions feluda/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"""
This module loads configuration provided in a .yml file and makes it available as dataclasses. The main role of this module is
1. to document the possible values of various fields in the configuration file
2. assist in providing auto complete and other IDE features via type support on python.

todo :
@dennyabrain used dacite as a quick way to convert nested dicts to python dataclasess. While I am happy with its performance so far, I am happy to consider a different solution while also accounting for data validation, which is not done as of now.
"""

import logging
from typing import List, Optional, Union
import yaml
from dataclasses import dataclass
from dacite import from_dict

log = logging.getLogger(__name__)

@dataclass
class StoreESParameters:
host_name: str
image_index_name: str
text_index_name: str
video_index_name: str
audio_index_name: str


@dataclass
class StorePostgresParameters:
table_names: List[str]


@dataclass
class StoreEntity:
label: str
type: str
parameters: Union[StoreESParameters, StorePostgresParameters]


@dataclass
class StoreConfig:
entities: List[StoreEntity]


@dataclass
class QueueParameters:
host_name: str
queues: List[dict]


@dataclass
class QueueConfig:
label: str
type: str
parameters: QueueParameters


@dataclass
class ServerParameters:
port: int
type: str


@dataclass
class ServerConfig:
label: str
parameters: ServerParameters


@dataclass
class OperatorParameters:
name: str
type: str
parameters: object


@dataclass
class OperatorConfig:
label: str
parameters: List[OperatorParameters]


@dataclass
class Config:
store: Optional[StoreConfig]
queue: Optional[QueueConfig]
server: Optional[ServerConfig]
operators: Optional[OperatorConfig]


def load(filepath) -> Config:
log.info("Loading config from " + filepath)
with open(filepath) as f:
parameters = yaml.safe_load(f)
config = from_dict(data_class=Config, data=parameters)
return config
19 changes: 19 additions & 0 deletions feluda/feluda.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import logging
from feluda import config
from enum import Enum

log = logging.getLogger(__name__)

class Feluda:
def __init__(self, configPath):
self.config = config.load(configPath)
self.store = None
if self.config.operators:
from feluda.operator import Operator
self.operators = Operator(self.config.operators)

def setup(self):
if self.operators:
self.operators.setup()

# Some important code here
28 changes: 28 additions & 0 deletions feluda/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import logging
import pprint
import os

logging.basicConfig(level="INFO")
pp = pprint.PrettyPrinter(indent=2)


class Logger:
def __init__(self, moduleName):
self.environment = os.environ.get("ENVIRONMENT", "DEVELOPMENT")
self.log = logging.getLogger(moduleName)

def info(self, msg, *args, **kwargs):
self.log.info(msg, *args, **kwargs)

def debug(self, msg):
if self.environment == "DEVELOPMENT":
self.log.debug(msg)

def exception(self, msg):
self.log.exception(msg)

def prettyprint(self, msg):
pp.pprint(msg)

def error(self, msg, *args, **kwargs):
self.log.error(self, msg, *args, **kwargs)
Empty file added feluda/models/__init__.py
Empty file.
29 changes: 29 additions & 0 deletions feluda/models/media.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from enum import Enum


class MediaMode(Enum):
UNSUPPORTED = "unsupported"
FILE = "file"
URL = "url"
LOCAL_FILE_PATH = "local_file_path"


class MediaType(Enum):
UNSUPPORTED = "unsupported"
TEXT = "text"
IMAGE = "image"
VIDEO = "video"
AUDIO = "audio"

@classmethod
def make(media_type):
if media_type == "text":
return MediaType.TEXT
elif media_type == "image":
return MediaType.IMAGE
elif media_type == "video":
return MediaType.VIDEO
elif media_type == "audio":
return MediaType.AUDIO
else:
return MediaType.UNSUPPORTED
Loading
Loading