negi2725 commited on
Commit
2ac5e53
·
verified ·
1 Parent(s): 9bcd4bc

Update app/services/legal_bert.py

Browse files
Files changed (1) hide show
  1. app/services/legal_bert.py +3 -3
app/services/legal_bert.py CHANGED
@@ -24,7 +24,7 @@ class LegalBertService:
24
  os.makedirs(extractPath)
25
  logger.info(f"Created model directory: {extractPath}")
26
 
27
- # Check if model is already extracted
28
  if os.path.exists(os.path.join(extractPath, "config.json")):
29
  logger.info("Model already extracted")
30
  return True
@@ -42,14 +42,14 @@ class LegalBertService:
42
 
43
  def _load_model(self):
44
  try:
45
- # Check for zip file first
46
  zipPath = os.path.join("./models", "legalbert_epoch4.zip")
47
 
48
  if os.path.exists(zipPath):
49
  if self._extract_model_from_zip(zipPath, settings.legal_bert_model_path):
50
  logger.info("Model zip file found and extracted")
51
 
52
- # Try to load the actual model
53
  if os.path.exists(settings.legal_bert_model_path) and os.path.exists(os.path.join(settings.legal_bert_model_path, "config.json")):
54
  try:
55
  import torch
 
24
  os.makedirs(extractPath)
25
  logger.info(f"Created model directory: {extractPath}")
26
 
27
+
28
  if os.path.exists(os.path.join(extractPath, "config.json")):
29
  logger.info("Model already extracted")
30
  return True
 
42
 
43
  def _load_model(self):
44
  try:
45
+
46
  zipPath = os.path.join("./models", "legalbert_epoch4.zip")
47
 
48
  if os.path.exists(zipPath):
49
  if self._extract_model_from_zip(zipPath, settings.legal_bert_model_path):
50
  logger.info("Model zip file found and extracted")
51
 
52
+
53
  if os.path.exists(settings.legal_bert_model_path) and os.path.exists(os.path.join(settings.legal_bert_model_path, "config.json")):
54
  try:
55
  import torch