Skip to content

Commit

Permalink
🎉 Enable good/bad labeling of similar charts by users
Browse files Browse the repository at this point in the history
  • Loading branch information
Marigold committed Jan 17, 2025
1 parent 288ff37 commit bd1e926
Show file tree
Hide file tree
Showing 12 changed files with 1,183 additions and 109 deletions.
5 changes: 3 additions & 2 deletions apps/wizard/app_pages/indicator_upgrade/charts_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import etl.grapher.model as gm
from apps.chart_sync.admin_api import AdminAPI
from apps.wizard.utils import set_states
from apps.wizard.utils.cached import get_grapher_user_id
from apps.wizard.utils.cached import get_grapher_user
from apps.wizard.utils.components import st_toast_error, st_wizard_page_link
from apps.wizard.utils.db import WizardDB
from etl.config import OWID_ENV
Expand Down Expand Up @@ -97,7 +97,8 @@ def push_new_charts(charts: List[gm.Chart]) -> None:
"""Updating charts in the database."""
# Use Tailscale user if it is available, otherwise use GRAPHER_USER_ID from env
if "X-Forwarded-For" in st.context.headers:
grapher_user_id = get_grapher_user_id(st.context.headers["X-Forwarded-For"])
grapher_user = get_grapher_user(st.context.headers["X-Forwarded-For"])
grapher_user_id = grapher_user.id if grapher_user else None
else:
grapher_user_id = None

Expand Down
5 changes: 1 addition & 4 deletions apps/wizard/app_pages/insight_search/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@

import streamlit as st
import torch
from joblib import Memory
from sentence_transformers import SentenceTransformer, util
from structlog import get_logger

from etl.paths import CACHE_DIR

memory = Memory(CACHE_DIR, verbose=0)
from etl.config import memory

# Initialize log.
log = get_logger()
Expand Down
Loading

0 comments on commit bd1e926

Please sign in to comment.