m7mdal7aj commited on
Commit
a2b2a3a
1 Parent(s): 755501b

Update my_model/utilities/gen_utilities.py

Browse files
my_model/utilities/gen_utilities.py CHANGED
@@ -275,26 +275,27 @@ def get_image_path(name, path_type):
275
 
276
  def get_model_path(model_name):
277
  """
278
- Get the path to the specified model within the 'models' folder.
279
 
280
  Args:
281
- model_name (str): The name of the model file.
282
 
283
  Returns:
284
- str: Absolute path to the specified model file.
285
  """
286
  # Directory of the current script
287
  current_script_dir = os.path.dirname(os.path.abspath(__file__))
288
 
289
- # Directory of the 'my_model' folder (parent of the 'utilities' folder)
290
- my_model_dir = os.path.dirname(current_script_dir)
291
 
292
  # Path to the 'models/{model_name}' folder
293
- model_path = os.path.join(my_model_dir, "models", model_name)
294
 
295
  return model_path
296
 
297
 
 
298
  def free_gpu_resources():
299
  """
300
  Clears GPU memory.
 
275
 
276
  def get_model_path(model_name):
277
  """
278
+ Get the path to the specified model folder.
279
 
280
  Args:
281
+ model_name (str): Name of the model folder.
282
 
283
  Returns:
284
+ str: Absolute path to the specified model folder.
285
  """
286
  # Directory of the current script
287
  current_script_dir = os.path.dirname(os.path.abspath(__file__))
288
 
289
+ # Directory of the 'app' folder (parent of the 'my_model' folder)
290
+ app_dir = os.path.dirname(os.path.dirname(current_script_dir))
291
 
292
  # Path to the 'models/{model_name}' folder
293
+ model_path = os.path.join(app_dir, "models", model_name)
294
 
295
  return model_path
296
 
297
 
298
+
299
  def free_gpu_resources():
300
  """
301
  Clears GPU memory.