Skip to content

Commit

Permalink
Add alternate file paths bookworm.app
Browse files Browse the repository at this point in the history
  • Loading branch information
sue-t-boyd committed Mar 7, 2024
1 parent 6326616 commit ac65fcd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions bookworm/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@
vo = voyageai.Client(api_key=api_key)

# load preprocessed distances/indices
distances = np.load('bookworm/data/distances_updated.npy')
indices = np.load('bookworm/data/indices_updated.npy')
try:
distances = np.load('bookworm/data/distances_updated.npy')
except:
distances = np.load('data/distances_updated.npy')
try:
indices = np.load('bookworm/data/indices_updated.npy')
except:
indices = np.load('data/indices_updated.npy')

class HelperFunctions:

Expand Down
8 changes: 6 additions & 2 deletions bookworm/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@
from unittest.mock import patch

import pandas as pd

from app import main, display_avg_ratings_slider, display_num_ratings_slider, \
try:
from app import main, display_avg_ratings_slider, display_num_ratings_slider, \
display_search_mode_ui, display_search_value_ui, \
display_genre_dropdown, display_search_button, execute_query
except:
from bookworm.app import main, display_avg_ratings_slider, display_num_ratings_slider, \
display_search_mode_ui, display_search_value_ui, \
display_genre_dropdown, display_search_button, execute_query

Expand Down

0 comments on commit ac65fcd

Please sign in to comment.