Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c38f8f2ef8 | ||
478dc3a8a1 | |||
|
2d4bc5fa2f | ||
291bf9473a |
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "embeddingbuddy"
|
name = "embeddingbuddy"
|
||||||
version = "0.8.0"
|
version = "0.8.2"
|
||||||
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"
|
||||||
@@ -54,3 +54,6 @@ where = ["src"]
|
|||||||
|
|
||||||
[tool.setuptools.package-dir]
|
[tool.setuptools.package-dir]
|
||||||
"" = "src"
|
"" = "src"
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
embeddingbuddy = ["assets/**/*"]
|
||||||
|
@@ -16,9 +16,9 @@ def create_app():
|
|||||||
from .ui.callbacks.visualization import VisualizationCallbacks
|
from .ui.callbacks.visualization import VisualizationCallbacks
|
||||||
from .ui.callbacks.interactions import InteractionCallbacks
|
from .ui.callbacks.interactions import InteractionCallbacks
|
||||||
|
|
||||||
# Get the project root directory (two levels up from this file)
|
# Get the assets directory relative to this module
|
||||||
project_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
module_dir = os.path.dirname(__file__)
|
||||||
assets_path = os.path.join(project_root, "assets")
|
assets_path = os.path.join(module_dir, "assets")
|
||||||
|
|
||||||
app = dash.Dash(
|
app = dash.Dash(
|
||||||
__name__,
|
__name__,
|
||||||
@@ -167,8 +167,15 @@ def serve(host=None, port=None, dev=False, debug=False):
|
|||||||
|
|
||||||
# Only print startup messages in main process (not in Flask reloader)
|
# Only print startup messages in main process (not in Flask reloader)
|
||||||
if not os.environ.get("WERKZEUG_RUN_MAIN"):
|
if not os.environ.get("WERKZEUG_RUN_MAIN"):
|
||||||
|
from importlib.metadata import version
|
||||||
|
|
||||||
|
try:
|
||||||
|
pkg_version = version("embeddingbuddy")
|
||||||
|
except Exception:
|
||||||
|
pkg_version = "unknown"
|
||||||
|
|
||||||
mode = "development" if dev else ("debug" if debug else "production")
|
mode = "development" if dev else ("debug" if debug else "production")
|
||||||
print(f"Starting EmbeddingBuddy in {mode} mode...")
|
print(f"Starting EmbeddingBuddy v{pkg_version} in {mode} mode...")
|
||||||
print("Loading dependencies (this may take a few seconds)...")
|
print("Loading dependencies (this may take a few seconds)...")
|
||||||
print(f"Server will start at http://{actual_host}:{actual_port}")
|
print(f"Server will start at http://{actual_host}:{actual_port}")
|
||||||
if use_reloader:
|
if use_reloader:
|
||||||
|
@@ -660,14 +660,12 @@ class DataProcessingCallbacks:
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get the project root directory (four levels up from this file)
|
# Get the embeddingbuddy package directory (three levels up from this file)
|
||||||
current_file = os.path.abspath(__file__)
|
current_file = os.path.abspath(__file__)
|
||||||
project_root = os.path.dirname(
|
package_dir = os.path.dirname(
|
||||||
os.path.dirname(
|
os.path.dirname(os.path.dirname(current_file))
|
||||||
os.path.dirname(os.path.dirname(os.path.dirname(current_file)))
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
sample_file_path = os.path.join(project_root, "assets", "sample-txt.md")
|
sample_file_path = os.path.join(package_dir, "assets", "sample-txt.md")
|
||||||
|
|
||||||
if os.path.exists(sample_file_path):
|
if os.path.exists(sample_file_path):
|
||||||
with open(sample_file_path, "r", encoding="utf-8") as file:
|
with open(sample_file_path, "r", encoding="utf-8") as file:
|
||||||
|
Reference in New Issue
Block a user