Spaces:
Running
Running
Sadjad Alikhani
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,6 +75,19 @@ def load_custom_model():
|
|
| 75 |
|
| 76 |
import importlib.util
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
# Function to dynamically load a Python module from a given file path
|
| 79 |
def load_module_from_path(module_name, file_path):
|
| 80 |
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
|
@@ -155,7 +168,6 @@ def process_p_file(uploaded_file, percentage_idx, complexity_idx):
|
|
| 155 |
sys.stdout = sys.__stdout__ # Reset print statements
|
| 156 |
|
| 157 |
|
| 158 |
-
|
| 159 |
# Function to handle logic based on whether a file is uploaded or not
|
| 160 |
def los_nlos_classification(file, percentage_idx, complexity_idx):
|
| 161 |
if file is not None:
|
|
|
|
| 75 |
|
| 76 |
import importlib.util
|
| 77 |
|
| 78 |
+
# Function to dynamically load a Python module from a given file path
|
| 79 |
+
def load_module_from_path(module_name, file_path):
|
| 80 |
+
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 81 |
+
module = importlib.util.module_from_spec(spec)
|
| 82 |
+
spec.loader.exec_module(module)
|
| 83 |
+
return module
|
| 84 |
+
|
| 85 |
+
import sys
|
| 86 |
+
import os
|
| 87 |
+
import subprocess
|
| 88 |
+
import pickle
|
| 89 |
+
import importlib.util
|
| 90 |
+
|
| 91 |
# Function to dynamically load a Python module from a given file path
|
| 92 |
def load_module_from_path(module_name, file_path):
|
| 93 |
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
|
|
|
| 168 |
sys.stdout = sys.__stdout__ # Reset print statements
|
| 169 |
|
| 170 |
|
|
|
|
| 171 |
# Function to handle logic based on whether a file is uploaded or not
|
| 172 |
def los_nlos_classification(file, percentage_idx, complexity_idx):
|
| 173 |
if file is not None:
|