Spaces:
Running
Running
File size: 682 Bytes
d407fa8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import torch
from transformers import set_seed
from pathlib import Path
import os
SMELLS = [
"BuiltInBehavior",
"ExtraUsageOfArrays",
"ImproperDataStructure",
"LackingBreak",
"NotCaching",
"OveruseOfLoops",
"UnnecessaryConditionals",
"UnnecessaryRecursion",
"UnnecessaryTypeConversion",
]
# Configurations
DROPOUT_PROB = 0.1
HIDDEN_SIZE = 768
NUM_LABELS = 9
LAST_NUM_NEURON = 9
BEST_THRESHOLD = 0.3
PRETRAINED_MODEL = "microsoft/graphcodebert-base"
MODEL_SAVE_DIR = Path(__file__).parents[1] / "models_weights"
WEIGHTS_FILE_NAME = "weights.bin"
MODEL_SAVE_PATH = MODEL_SAVE_DIR / WEIGHTS_FILE_NAME
HF_REPO_NAME = f"mjavadmt/EnergySmell" |