Danialebrat's picture
Finalizing deployment
458a369
raw
history blame contribute delete
834 Bytes
"""
HuggingFace Spaces wrapper for Sabian Brand Sentiment Dashboard.
Delegates to visualization_brand_sentiment/app.py without modifying the underlying code.
"""
import os
import sys
# Compute paths based on this wrapper's location
_root_dir = os.path.dirname(os.path.abspath(__file__))
_app_dir = os.path.join(_root_dir, "visualization_brand_sentiment")
_app_path = os.path.join(_app_dir, "app.py")
# Add the inner app's directory to sys.path so its relative imports resolve
if _app_dir not in sys.path:
sys.path.insert(0, _app_dir)
# Override __file__ so the inner app resolves all its paths correctly
# (config, images, etc. are relative to its own location)
__file__ = _app_path
# Execute the inner app in the current scope
with open(_app_path, "r", encoding="utf-8") as _f:
exec(compile(_f.read(), _app_path, "exec"))