Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,22 @@ def solve_problem(problem, max_iterations, reward_threshold, swift_model_id, sag
|
|
31 |
|
32 |
# specify the path to the prompt templates
|
33 |
# prompt_template_dir = './swiftsage/prompt_templates'
|
34 |
-
prompt_template_dir = resource_filename('swiftsage', 'prompt_templates')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
dataset = []
|
36 |
embeddings = [] # TODO: for retrieval augmentation (not implemented yet now)
|
37 |
s2 = SwiftSage(
|
|
|
31 |
|
32 |
# specify the path to the prompt templates
|
33 |
# prompt_template_dir = './swiftsage/prompt_templates'
|
34 |
+
# prompt_template_dir = resource_filename('swiftsage', 'prompt_templates')
|
35 |
+
|
36 |
+
# Try multiple locations for the prompt templates
|
37 |
+
possible_paths = [
|
38 |
+
resource_filename('swiftsage', 'prompt_templates'),
|
39 |
+
os.path.join(os.path.dirname(__file__), '..', 'swiftsage', 'prompt_templates'),
|
40 |
+
os.path.join(os.path.dirname(__file__), 'swiftsage', 'prompt_templates'),
|
41 |
+
'/app/swiftsage/prompt_templates', # For Docker environments
|
42 |
+
]
|
43 |
+
|
44 |
+
prompt_template_dir = None
|
45 |
+
for path in possible_paths:
|
46 |
+
if os.path.exists(path):
|
47 |
+
prompt_template_dir = path
|
48 |
+
break
|
49 |
+
|
50 |
dataset = []
|
51 |
embeddings = [] # TODO: for retrieval augmentation (not implemented yet now)
|
52 |
s2 = SwiftSage(
|