Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -2
src/streamlit_app.py
CHANGED
|
@@ -16,10 +16,13 @@ import streamlit as st
|
|
| 16 |
import torch
|
| 17 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 18 |
from dotenv import load_dotenv
|
|
|
|
| 19 |
load_dotenv()
|
| 20 |
|
| 21 |
import base64
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
APP_HOME_URL = "https://www.brundagelab.org/research/apps/" # change to your desired destination
|
| 24 |
|
| 25 |
def _img_to_data_uri(path: str) -> str:
|
|
@@ -33,7 +36,7 @@ def brundage_header():
|
|
| 33 |
col1, col2 = st.columns([2, 5])
|
| 34 |
|
| 35 |
with col1:
|
| 36 |
-
logo_path =
|
| 37 |
logo_uri = _img_to_data_uri(logo_path)
|
| 38 |
|
| 39 |
st.markdown(
|
|
|
|
| 16 |
import torch
|
| 17 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 18 |
from dotenv import load_dotenv
|
| 19 |
+
from pathlib import Path
|
| 20 |
load_dotenv()
|
| 21 |
|
| 22 |
import base64
|
| 23 |
+
# Absolute path to this file's directory (e.g., /app/src)
|
| 24 |
+
HERE = Path(__file__).resolve().parent
|
| 25 |
+
ASSETS_DIR = HERE / "assets"
|
| 26 |
APP_HOME_URL = "https://www.brundagelab.org/research/apps/" # change to your desired destination
|
| 27 |
|
| 28 |
def _img_to_data_uri(path: str) -> str:
|
|
|
|
| 36 |
col1, col2 = st.columns([2, 5])
|
| 37 |
|
| 38 |
with col1:
|
| 39 |
+
logo_path = ASSETS_DIR / "brundage_logo.png"
|
| 40 |
logo_uri = _img_to_data_uri(logo_path)
|
| 41 |
|
| 42 |
st.markdown(
|