Jin Zhu commited on
Commit
a9c7cad
·
1 Parent(s): d1b2a4a

Update app.py

Browse files
Files changed (1) hide show
  1. src/app.py +6 -1
src/app.py CHANGED
@@ -1,6 +1,11 @@
1
  import os
2
  from pathlib import Path
3
 
 
 
 
 
 
4
  # -----------------
5
  # Fix Streamlit Permission Issues
6
  # -----------------
@@ -80,7 +85,7 @@ def load_model(from_pretrained, base_model, cache_dir, device):
80
  # Configuration
81
  # -----------------
82
  MODEL_CONFIG = {
83
- 'from_pretrained': './FineTune/ckpt/lr_0.0001_a_1',
84
  'base_model': 'gemma-1b',
85
  'cache_dir': '../cache',
86
  'device': 'mps',
 
1
  import os
2
  from pathlib import Path
3
 
4
+ # -----------------
5
+ # Get the directory where app.py is located
6
+ # -----------------
7
+ APP_DIR = Path(__file__).parent.resolve()
8
+
9
  # -----------------
10
  # Fix Streamlit Permission Issues
11
  # -----------------
 
85
  # Configuration
86
  # -----------------
87
  MODEL_CONFIG = {
88
+ 'from_pretrained': str(APP_DIR / 'FineTune' / 'ckpt' / 'lr_0.0001_a_1'),
89
  'base_model': 'gemma-1b',
90
  'cache_dir': '../cache',
91
  'device': 'mps',