Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ warnings.filterwarnings("ignore")
|
|
23 |
MODEL_NAME = "microsoft/codebert-base"
|
24 |
MAX_LENGTH = 512
|
25 |
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
26 |
-
DATASET_PATH = "
|
27 |
|
28 |
# Initialize models with caching
|
29 |
@st.cache_resource
|
@@ -40,13 +40,13 @@ def load_models():
|
|
40 |
def load_dataset():
|
41 |
try:
|
42 |
# Extract dataset if needed
|
43 |
-
if not os.path.exists("
|
44 |
with zipfile.ZipFile(DATASET_PATH, 'r') as zip_ref:
|
45 |
zip_ref.extractall(".")
|
46 |
|
47 |
# Load sample pairs (modify this based on your dataset structure)
|
48 |
clone_pairs = []
|
49 |
-
base_path = "
|
50 |
|
51 |
# Example: Load one pair from each clone type
|
52 |
for clone_type in ["Clone_Type1", "Clone_Type2", "Clone_Type3 - ST"]:
|
|
|
23 |
MODEL_NAME = "microsoft/codebert-base"
|
24 |
MAX_LENGTH = 512
|
25 |
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
26 |
+
DATASET_PATH = "archive (1).zip" # Update this path if needed
|
27 |
|
28 |
# Initialize models with caching
|
29 |
@st.cache_resource
|
|
|
40 |
def load_dataset():
|
41 |
try:
|
42 |
# Extract dataset if needed
|
43 |
+
if not os.path.exists("Subject_CloneTypes_Directories"):
|
44 |
with zipfile.ZipFile(DATASET_PATH, 'r') as zip_ref:
|
45 |
zip_ref.extractall(".")
|
46 |
|
47 |
# Load sample pairs (modify this based on your dataset structure)
|
48 |
clone_pairs = []
|
49 |
+
base_path = "Subject_CloneTypes_Directories"
|
50 |
|
51 |
# Example: Load one pair from each clone type
|
52 |
for clone_type in ["Clone_Type1", "Clone_Type2", "Clone_Type3 - ST"]:
|