Sadjad Alikhani commited on
Commit
92aed37
·
verified ·
1 Parent(s): d2d9264

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -69,9 +69,23 @@ def process_p_file(uploaded_file, percentage_idx, complexity_idx):
69
  else:
70
  return f"Directory {model_repo_dir} does not exist."
71
 
72
- print("a")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  from lwm_model import LWM
74
- print("b")
75
  device = 'cpu'
76
  print(f"Loading the LWM model on {device}...")
77
  model = LWM.from_pretrained(device=device)
 
69
  else:
70
  return f"Directory {model_repo_dir} does not exist."
71
 
72
+ # Debugging: Check if the directory exists and print contents
73
+ if os.path.exists(model_repo_dir):
74
+ os.chdir(model_repo_dir)
75
+ print(f"Changed working directory to {os.getcwd()}")
76
+ print(f"Directory content: {os.listdir(os.getcwd())}") # Debugging: Check repo content
77
+ else:
78
+ print(f"Directory {model_repo_dir} does not exist.")
79
+ return
80
+
81
+ # Step 2: Add the cloned repo to sys.path for imports
82
+ if model_repo_dir not in sys.path:
83
+ sys.path.append(model_repo_dir)
84
+
85
+ # Debugging: Print sys.path to ensure the cloned repo is in the path
86
+ print(f"sys.path: {sys.path}")
87
+
88
  from lwm_model import LWM
 
89
  device = 'cpu'
90
  print(f"Loading the LWM model on {device}...")
91
  model = LWM.from_pretrained(device=device)