Compare commits
5 Commits
ea01ce596d
...
v0.6.1
Author | SHA1 | Date | |
---|---|---|---|
963a21d0ab | |||
b12c248ea1 | |||
5695348f37 | |||
2f458884a2 | |||
89dcafd311 |
@@ -71,22 +71,15 @@ jobs:
|
|||||||
echo '```' >> release-notes.md
|
echo '```' >> release-notes.md
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: actions/create-release@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
NODE_OPTIONS: '--experimental-fetch'
|
||||||
with:
|
with:
|
||||||
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
tag_name: ${{ github.ref_name || github.event.inputs.version }}
|
tag_name: ${{ github.ref_name || github.event.inputs.version }}
|
||||||
release_name: Release ${{ github.ref_name || github.event.inputs.version }}
|
release_name: Release ${{ github.ref_name || github.event.inputs.version }}
|
||||||
body_path: release-notes.md
|
body_path: release-notes.md
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
files: |-
|
||||||
- name: Upload Release Assets
|
dist/*
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: dist/
|
|
||||||
asset_name: embeddingbuddy-dist
|
|
||||||
asset_content_type: application/zip
|
|
53
.github/workflows/docker-release.yml
vendored
Normal file
53
.github/workflows/docker-release.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
name: Docker Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=ref,event=tag
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Austin Godber - EmbeddingBuddy
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "embeddingbuddy"
|
name = "embeddingbuddy"
|
||||||
version = "0.5.1"
|
version = "0.6.0"
|
||||||
description = "A Python Dash application for interactive exploration and visualization of embedding vectors through dimensionality reduction techniques."
|
description = "A Python Dash application for interactive exploration and visualization of embedding vectors through dimensionality reduction techniques."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
|
@@ -12,9 +12,15 @@ def main():
|
|||||||
os.environ["EMBEDDINGBUDDY_ENV"] = "development"
|
os.environ["EMBEDDINGBUDDY_ENV"] = "development"
|
||||||
os.environ["EMBEDDINGBUDDY_DEBUG"] = "true"
|
os.environ["EMBEDDINGBUDDY_DEBUG"] = "true"
|
||||||
|
|
||||||
|
# Check for OpenSearch disable flag (optional for testing)
|
||||||
|
# Set EMBEDDINGBUDDY_OPENSEARCH_ENABLED=false to test without OpenSearch
|
||||||
|
opensearch_status = os.getenv("EMBEDDINGBUDDY_OPENSEARCH_ENABLED", "true")
|
||||||
|
opensearch_enabled = opensearch_status.lower() == "true"
|
||||||
|
|
||||||
print("🚀 Starting EmbeddingBuddy in development mode...")
|
print("🚀 Starting EmbeddingBuddy in development mode...")
|
||||||
print("📁 Auto-reload enabled - changes will trigger restart")
|
print("📁 Auto-reload enabled - changes will trigger restart")
|
||||||
print("🌐 Server will be available at http://127.0.0.1:8050")
|
print("🌐 Server will be available at http://127.0.0.1:8050")
|
||||||
|
print(f"🔍 OpenSearch: {'Enabled' if opensearch_enabled else 'Disabled'}")
|
||||||
print("⏹️ Press Ctrl+C to stop")
|
print("⏹️ Press Ctrl+C to stop")
|
||||||
|
|
||||||
app = create_app()
|
app = create_app()
|
||||||
|
@@ -13,6 +13,9 @@ def main():
|
|||||||
# Force production settings
|
# Force production settings
|
||||||
os.environ["EMBEDDINGBUDDY_ENV"] = "production"
|
os.environ["EMBEDDINGBUDDY_ENV"] = "production"
|
||||||
os.environ["EMBEDDINGBUDDY_DEBUG"] = "false"
|
os.environ["EMBEDDINGBUDDY_DEBUG"] = "false"
|
||||||
|
# Disable OpenSearch by default in production (can be overridden by setting env var)
|
||||||
|
if "EMBEDDINGBUDDY_OPENSEARCH_ENABLED" not in os.environ:
|
||||||
|
os.environ["EMBEDDINGBUDDY_OPENSEARCH_ENABLED"] = "false"
|
||||||
|
|
||||||
print("🚀 Starting EmbeddingBuddy in production mode...")
|
print("🚀 Starting EmbeddingBuddy in production mode...")
|
||||||
print(f"⚙️ Workers: {AppSettings.GUNICORN_WORKERS}")
|
print(f"⚙️ Workers: {AppSettings.GUNICORN_WORKERS}")
|
||||||
|
@@ -25,32 +25,23 @@ def create_app():
|
|||||||
meta_tags=[
|
meta_tags=[
|
||||||
{
|
{
|
||||||
"name": "description",
|
"name": "description",
|
||||||
"content": "Interactive embedding visualization tool for exploring high-dimensional vectors through dimensionality reduction techniques like PCA, t-SNE, and UMAP."
|
"content": "Interactive embedding visualization tool for exploring high-dimensional vectors through dimensionality reduction techniques like PCA, t-SNE, and UMAP.",
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "author",
|
|
||||||
"content": "EmbeddingBuddy"
|
|
||||||
},
|
},
|
||||||
|
{"name": "author", "content": "EmbeddingBuddy"},
|
||||||
{
|
{
|
||||||
"name": "keywords",
|
"name": "keywords",
|
||||||
"content": "embeddings, visualization, dimensionality reduction, PCA, t-SNE, UMAP, machine learning, data science"
|
"content": "embeddings, visualization, dimensionality reduction, PCA, t-SNE, UMAP, machine learning, data science",
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "viewport",
|
|
||||||
"content": "width=device-width, initial-scale=1.0"
|
|
||||||
},
|
},
|
||||||
|
{"name": "viewport", "content": "width=device-width, initial-scale=1.0"},
|
||||||
{
|
{
|
||||||
"property": "og:title",
|
"property": "og:title",
|
||||||
"content": "EmbeddingBuddy - Interactive Embedding Visualization"
|
"content": "EmbeddingBuddy - Interactive Embedding Visualization",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"property": "og:description",
|
"property": "og:description",
|
||||||
"content": "Explore and visualize embedding vectors through interactive 2D/3D plots with multiple dimensionality reduction techniques."
|
"content": "Explore and visualize embedding vectors through interactive 2D/3D plots with multiple dimensionality reduction techniques.",
|
||||||
},
|
},
|
||||||
{
|
{"property": "og:type", "content": "website"},
|
||||||
"property": "og:type",
|
|
||||||
"content": "website"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -85,6 +85,9 @@ class AppSettings:
|
|||||||
GUNICORN_KEEPALIVE = int(os.getenv("GUNICORN_KEEPALIVE", "5"))
|
GUNICORN_KEEPALIVE = int(os.getenv("GUNICORN_KEEPALIVE", "5"))
|
||||||
|
|
||||||
# OpenSearch Configuration
|
# OpenSearch Configuration
|
||||||
|
OPENSEARCH_ENABLED = (
|
||||||
|
os.getenv("EMBEDDINGBUDDY_OPENSEARCH_ENABLED", "True").lower() == "true"
|
||||||
|
)
|
||||||
OPENSEARCH_DEFAULT_SIZE = 100
|
OPENSEARCH_DEFAULT_SIZE = 100
|
||||||
OPENSEARCH_SAMPLE_SIZE = 5
|
OPENSEARCH_SAMPLE_SIZE = 5
|
||||||
OPENSEARCH_CONNECTION_TIMEOUT = 30
|
OPENSEARCH_CONNECTION_TIMEOUT = 30
|
||||||
|
@@ -82,19 +82,23 @@ class DataProcessingCallbacks:
|
|||||||
)
|
)
|
||||||
def render_tab_content(active_tab):
|
def render_tab_content(active_tab):
|
||||||
from ...ui.components.datasource import DataSourceComponent
|
from ...ui.components.datasource import DataSourceComponent
|
||||||
|
from ...config.settings import AppSettings
|
||||||
|
|
||||||
datasource = DataSourceComponent()
|
datasource = DataSourceComponent()
|
||||||
|
|
||||||
if active_tab == "opensearch-tab":
|
if active_tab == "opensearch-tab" and AppSettings.OPENSEARCH_ENABLED:
|
||||||
return [datasource.create_opensearch_tab()]
|
return [datasource.create_opensearch_tab()]
|
||||||
elif active_tab == "text-input-tab":
|
elif active_tab == "text-input-tab":
|
||||||
return [datasource.create_text_input_tab()]
|
return [datasource.create_text_input_tab()]
|
||||||
else:
|
else:
|
||||||
return [datasource.create_file_upload_tab()]
|
return [datasource.create_file_upload_tab()]
|
||||||
|
|
||||||
# Register callbacks for both data and prompts sections
|
# Register callbacks for both data and prompts sections (only if OpenSearch is enabled)
|
||||||
self._register_opensearch_callbacks("data", self.opensearch_client_data)
|
if AppSettings.OPENSEARCH_ENABLED:
|
||||||
self._register_opensearch_callbacks("prompts", self.opensearch_client_prompts)
|
self._register_opensearch_callbacks("data", self.opensearch_client_data)
|
||||||
|
self._register_opensearch_callbacks(
|
||||||
|
"prompts", self.opensearch_client_prompts
|
||||||
|
)
|
||||||
|
|
||||||
# Register collapsible section callbacks
|
# Register collapsible section callbacks
|
||||||
self._register_collapse_callbacks()
|
self._register_collapse_callbacks()
|
||||||
|
@@ -5,9 +5,31 @@ import dash_bootstrap_components as dbc
|
|||||||
class AboutComponent:
|
class AboutComponent:
|
||||||
def _get_about_content(self):
|
def _get_about_content(self):
|
||||||
return """
|
return """
|
||||||
# 🔍 Interactive Embedding Visualization
|
# 🔍 Interactive Embedding Vector Visualization
|
||||||
|
|
||||||
|
EmbeddingBuddy is a web application for interactive exploration and
|
||||||
|
visualization of embedding vectors through dimensionality reduction techniques
|
||||||
|
(PCA, t-SNE, UMAP).
|
||||||
|
|
||||||
|
You have two ways to get started:
|
||||||
|
|
||||||
|
1. Generate embeddings directly in the browser if it supports WebGPU.
|
||||||
|
2. Upload your NDJSON file containing embedding vectors and metadata.
|
||||||
|
|
||||||
|
## Generating Embeddings in Browser
|
||||||
|
|
||||||
|
1. Expand the "Generate Embeddings" section.
|
||||||
|
2. Input your text data (one entry per line).
|
||||||
|
1. Optionally you can use the built in sample data by clicking "Load Sample Data" button.
|
||||||
|
3. Click "Generate Embeddings" to create vectors using a pre-trained model.
|
||||||
|
|
||||||
|
## NDJSON File Format
|
||||||
|
|
||||||
|
```json
|
||||||
|
{"id": "doc_001", "embedding": [0.1, -0.3, 0.7, ...], "text": "Sample text content", "category": "news", "subcategory": "politics", "tags": ["election", "politics"]}
|
||||||
|
{"id": "doc_002", "embedding": [0.2, -0.1, 0.9, ...], "text": "Another example", "category": "review", "subcategory": "product", "tags": ["tech", "gadget"]}
|
||||||
|
```
|
||||||
|
|
||||||
EmbeddingBuddy is a modular Python Dash web application for interactive exploration and visualization of embedding vectors through dimensionality reduction techniques (PCA, t-SNE, UMAP).
|
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
@@ -35,26 +57,25 @@ EmbeddingBuddy is a modular Python Dash web application for interactive explorat
|
|||||||
return dbc.Modal(
|
return dbc.Modal(
|
||||||
[
|
[
|
||||||
dbc.ModalHeader(
|
dbc.ModalHeader(
|
||||||
dbc.ModalTitle("About EmbeddingBuddy"),
|
dbc.ModalTitle("Welcome to EmbeddingBuddy"),
|
||||||
close_button=True,
|
close_button=True,
|
||||||
),
|
),
|
||||||
dbc.ModalBody([
|
dbc.ModalBody(
|
||||||
dcc.Markdown(
|
[dcc.Markdown(self._get_about_content(), className="mb-0")]
|
||||||
self._get_about_content(),
|
),
|
||||||
className="mb-0"
|
dbc.ModalFooter(
|
||||||
)
|
[
|
||||||
]),
|
dbc.Button(
|
||||||
dbc.ModalFooter([
|
"Close",
|
||||||
dbc.Button(
|
id="about-modal-close",
|
||||||
"Close",
|
color="secondary",
|
||||||
id="about-modal-close",
|
n_clicks=0,
|
||||||
color="secondary",
|
)
|
||||||
n_clicks=0
|
]
|
||||||
)
|
),
|
||||||
]),
|
|
||||||
],
|
],
|
||||||
id="about-modal",
|
id="about-modal",
|
||||||
is_open=False,
|
is_open=True,
|
||||||
size="lg",
|
size="lg",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -65,5 +86,5 @@ EmbeddingBuddy is a modular Python Dash web application for interactive explorat
|
|||||||
color="outline-info",
|
color="outline-info",
|
||||||
size="sm",
|
size="sm",
|
||||||
n_clicks=0,
|
n_clicks=0,
|
||||||
className="ms-2"
|
className="ms-2",
|
||||||
)
|
)
|
@@ -1,6 +1,7 @@
|
|||||||
from dash import dcc, html
|
from dash import dcc, html
|
||||||
import dash_bootstrap_components as dbc
|
import dash_bootstrap_components as dbc
|
||||||
from .upload import UploadComponent
|
from .upload import UploadComponent
|
||||||
|
from embeddingbuddy.config.settings import AppSettings
|
||||||
|
|
||||||
|
|
||||||
class DataSourceComponent:
|
class DataSourceComponent:
|
||||||
@@ -9,15 +10,18 @@ class DataSourceComponent:
|
|||||||
|
|
||||||
def create_tabbed_interface(self):
|
def create_tabbed_interface(self):
|
||||||
"""Create tabbed interface for different data sources."""
|
"""Create tabbed interface for different data sources."""
|
||||||
|
tabs = [dbc.Tab(label="File Upload", tab_id="file-tab")]
|
||||||
|
|
||||||
|
# Only add OpenSearch tab if enabled
|
||||||
|
if AppSettings.OPENSEARCH_ENABLED:
|
||||||
|
tabs.append(dbc.Tab(label="OpenSearch", tab_id="opensearch-tab"))
|
||||||
|
|
||||||
return dbc.Card(
|
return dbc.Card(
|
||||||
[
|
[
|
||||||
dbc.CardHeader(
|
dbc.CardHeader(
|
||||||
[
|
[
|
||||||
dbc.Tabs(
|
dbc.Tabs(
|
||||||
[
|
tabs,
|
||||||
dbc.Tab(label="File Upload", tab_id="file-tab"),
|
|
||||||
dbc.Tab(label="OpenSearch", tab_id="opensearch-tab"),
|
|
||||||
],
|
|
||||||
id="data-source-tabs",
|
id="data-source-tabs",
|
||||||
active_tab="file-tab",
|
active_tab="file-tab",
|
||||||
)
|
)
|
||||||
|
@@ -3,6 +3,7 @@ import dash_bootstrap_components as dbc
|
|||||||
from .upload import UploadComponent
|
from .upload import UploadComponent
|
||||||
from .datasource import DataSourceComponent
|
from .datasource import DataSourceComponent
|
||||||
from .textinput import TextInputComponent
|
from .textinput import TextInputComponent
|
||||||
|
from embeddingbuddy.config.settings import AppSettings
|
||||||
|
|
||||||
|
|
||||||
class SidebarComponent:
|
class SidebarComponent:
|
||||||
@@ -102,6 +103,10 @@ class SidebarComponent:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _create_data_sources_item(self):
|
def _create_data_sources_item(self):
|
||||||
|
tooltip_text = "Load existing embeddings: upload files"
|
||||||
|
if AppSettings.OPENSEARCH_ENABLED:
|
||||||
|
tooltip_text += " or read from OpenSearch"
|
||||||
|
|
||||||
return dbc.AccordionItem(
|
return dbc.AccordionItem(
|
||||||
[
|
[
|
||||||
self.datasource_component.create_error_alert(),
|
self.datasource_component.create_error_alert(),
|
||||||
@@ -115,7 +120,7 @@ class SidebarComponent:
|
|||||||
className="fas fa-info-circle text-muted",
|
className="fas fa-info-circle text-muted",
|
||||||
style={"cursor": "pointer"},
|
style={"cursor": "pointer"},
|
||||||
id="load-embeddings-info-icon",
|
id="load-embeddings-info-icon",
|
||||||
title="Load existing embeddings: upload files or read from OpenSearch",
|
title=tooltip_text,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
@@ -16,14 +16,14 @@ class TextInputComponent:
|
|||||||
"""Create the complete text input interface with model selection and processing options."""
|
"""Create the complete text input interface with model selection and processing options."""
|
||||||
return html.Div(
|
return html.Div(
|
||||||
[
|
[
|
||||||
# Model selection section
|
|
||||||
self._create_model_selection(),
|
|
||||||
html.Hr(),
|
|
||||||
# Text input section
|
# Text input section
|
||||||
self._create_text_input_area(),
|
self._create_text_input_area(),
|
||||||
# Text action buttons
|
# Text action buttons
|
||||||
self._create_text_action_buttons(),
|
self._create_text_action_buttons(),
|
||||||
html.Hr(),
|
html.Hr(),
|
||||||
|
# Model selection section
|
||||||
|
self._create_model_selection(),
|
||||||
|
html.Hr(),
|
||||||
# Processing options
|
# Processing options
|
||||||
self._create_processing_options(),
|
self._create_processing_options(),
|
||||||
html.Hr(),
|
html.Hr(),
|
||||||
|
@@ -24,13 +24,16 @@ class AppLayout:
|
|||||||
[
|
[
|
||||||
html.Div(
|
html.Div(
|
||||||
[
|
[
|
||||||
html.H1("EmbeddingBuddy", className="text-center mb-4 d-inline"),
|
html.H1(
|
||||||
|
"EmbeddingBuddy",
|
||||||
|
className="text-center mb-4 d-inline",
|
||||||
|
),
|
||||||
html.Div(
|
html.Div(
|
||||||
[self.about.create_about_button()],
|
[self.about.create_about_button()],
|
||||||
className="float-end"
|
className="float-end",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
className="d-flex justify-content-between align-items-center"
|
className="d-flex justify-content-between align-items-center",
|
||||||
),
|
),
|
||||||
# Load Transformers.js from CDN
|
# Load Transformers.js from CDN
|
||||||
html.Script(
|
html.Script(
|
||||||
|
Reference in New Issue
Block a user