stefanoviel commited on
Commit
c25929c
·
1 Parent(s): 2c1d8e4

fixing paths

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -5
src/streamlit_app.py CHANGED
@@ -5,12 +5,14 @@ from sentence_transformers import SentenceTransformer, util
5
  import torch
6
  from spellchecker import SpellChecker
7
  from io import StringIO
 
8
 
9
- # --- Configuration ---
10
- EMBEDDING_MODEL = 'sentence-transformers/all-MiniLM-L6-v2'
11
- # Use /tmp directory for temporary files in Hugging Face Spaces
12
- EMBEDDINGS_FILE = '/tmp/paper_embeddings.pt'
13
- DATA_FILE = '/tmp/papers_data.pkl'
 
14
 
15
  # --- Data Loading and Preparation ---
16
  CSV_FILE = 'papers_with_abstracts_parallel.csv'
 
5
  import torch
6
  from spellchecker import SpellChecker
7
  from io import StringIO
8
+ from pathlib import Path
9
 
10
+ script_dir = Path(__file__).parent
11
+
12
+ # Define paths relative to the script's directory
13
+ DATA_FILE = script_dir / 'papers_data.pkl'
14
+ EMBEDDINGS_FILE = script_dir / 'paper_embeddings.pt'
15
+ CSV_FILE = script_dir / 'papers_with_abstracts_parallel.csv'
16
 
17
  # --- Data Loading and Preparation ---
18
  CSV_FILE = 'papers_with_abstracts_parallel.csv'