yifan0sun commited on
Commit
a44938d
·
1 Parent(s): b53da06

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +12 -0
server.py CHANGED
@@ -9,6 +9,18 @@ from ROBERTAmodel import *
9
  from BERTmodel import *
10
  from DISTILLBERTmodel import *
11
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  VISUALIZER_CLASSES = {
13
  "BERT": BERTVisualizer,
14
  "RoBERTa": RoBERTaVisualizer,
 
9
  from BERTmodel import *
10
  from DISTILLBERTmodel import *
11
 
12
+ import shutil
13
+ import os
14
+
15
+ CACHE_DIR = "./hf_cache"
16
+ if os.path.exists(CACHE_DIR):
17
+ try:
18
+ shutil.rmtree(CACHE_DIR)
19
+ print("✅ Cleared hf_cache directory")
20
+ except Exception as e:
21
+ print("❌ Failed to clear hf_cache:", e)
22
+
23
+
24
  VISUALIZER_CLASSES = {
25
  "BERT": BERTVisualizer,
26
  "RoBERTa": RoBERTaVisualizer,