agba-engine 5.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agba_engine-5.0.0/MANIFEST.in +7 -0
- agba_engine-5.0.0/PKG-INFO +14 -0
- agba_engine-5.0.0/README.md +3 -0
- agba_engine-5.0.0/agba_engine/core/engine.py +37 -0
- agba_engine-5.0.0/agba_engine.egg-info/PKG-INFO +14 -0
- agba_engine-5.0.0/agba_engine.egg-info/SOURCES.txt +10 -0
- agba_engine-5.0.0/agba_engine.egg-info/dependency_links.txt +1 -0
- agba_engine-5.0.0/agba_engine.egg-info/requires.txt +2 -0
- agba_engine-5.0.0/agba_engine.egg-info/top_level.txt +1 -0
- agba_engine-5.0.0/pyproject.toml +18 -0
- agba_engine-5.0.0/setup.cfg +4 -0
- agba_engine-5.0.0/setup.py +7 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agba_engine
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: Global Cultural Assistant & Heritage Preservation Engine.
|
|
5
|
+
Author: Aruna Olanrewaju Kabiru
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: torch
|
|
10
|
+
Requires-Dist: huggingface_hub
|
|
11
|
+
|
|
12
|
+
# Agba Engine
|
|
13
|
+
|
|
14
|
+
**Agba Engine** is a Global Cultural Assistant and Heritage Preservation Framework designed for high-performance retrieval, indexing, and preservation of cultural regalia, visual artifacts, and audio metadata across diverse global traditions.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import torch
|
|
3
|
+
from huggingface_hub import hf_hub_download
|
|
4
|
+
from agba_engine.search.vector import compute_cosine_similarity
|
|
5
|
+
from agba_engine.utils.fallback import resolve_oov_fallback
|
|
6
|
+
|
|
7
|
+
class AgbaSearchEngine:
|
|
8
|
+
def __init__(self, index_path="agba_tri_vector_index_v5.pt", repo_id="OcculusPanther/agba-vector-index-v5"):
|
|
9
|
+
# Auto-download from Hugging Face if file isn't present locally
|
|
10
|
+
if not os.path.exists(index_path):
|
|
11
|
+
print(f"⏳ Index `{index_path}` not found locally. Fetching official weights from Hugging Face ({repo_id})...")
|
|
12
|
+
try:
|
|
13
|
+
index_path = hf_hub_download(
|
|
14
|
+
repo_id=repo_id,
|
|
15
|
+
filename="agba_tri_vector_index_v5.pt"
|
|
16
|
+
)
|
|
17
|
+
print("✅ Index binary successfully downloaded from Hugging Face!")
|
|
18
|
+
except Exception as e:
|
|
19
|
+
raise RuntimeError(f"Failed to download index from Hugging Face: {e}")
|
|
20
|
+
|
|
21
|
+
# Security Hardening: weights_only=True prevents arbitrary code execution via pickle
|
|
22
|
+
try:
|
|
23
|
+
checkpoint = torch.load(index_path, weights_only=True)
|
|
24
|
+
except TypeError:
|
|
25
|
+
checkpoint = torch.load(index_path)
|
|
26
|
+
|
|
27
|
+
self.version = checkpoint["version"]
|
|
28
|
+
self.database = checkpoint["database"]
|
|
29
|
+
self.total_assets = checkpoint["total_assets"]
|
|
30
|
+
self.categories = checkpoint["metadata"]["regalia_classes"]
|
|
31
|
+
|
|
32
|
+
def search_by_vision(self, visual_vector, top_k=3):
|
|
33
|
+
results = compute_cosine_similarity(visual_vector, self.database)
|
|
34
|
+
return results[:top_k]
|
|
35
|
+
|
|
36
|
+
def get_audio_surrogate(self, asset_id, available_segments=set()):
|
|
37
|
+
return resolve_oov_fallback(asset_id, available_segments)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agba_engine
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: Global Cultural Assistant & Heritage Preservation Engine.
|
|
5
|
+
Author: Aruna Olanrewaju Kabiru
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: torch
|
|
10
|
+
Requires-Dist: huggingface_hub
|
|
11
|
+
|
|
12
|
+
# Agba Engine
|
|
13
|
+
|
|
14
|
+
**Agba Engine** is a Global Cultural Assistant and Heritage Preservation Framework designed for high-performance retrieval, indexing, and preservation of cultural regalia, visual artifacts, and audio metadata across diverse global traditions.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
agba_engine.egg-info/PKG-INFO
|
|
6
|
+
agba_engine.egg-info/SOURCES.txt
|
|
7
|
+
agba_engine.egg-info/dependency_links.txt
|
|
8
|
+
agba_engine.egg-info/requires.txt
|
|
9
|
+
agba_engine.egg-info/top_level.txt
|
|
10
|
+
agba_engine/core/engine.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agba_engine"
|
|
7
|
+
version = "5.0.0"
|
|
8
|
+
description = "Global Cultural Assistant & Heritage Preservation Engine."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Aruna Olanrewaju Kabiru" }
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"torch",
|
|
17
|
+
"huggingface_hub"
|
|
18
|
+
]
|