CanerDedeoglu commited on
Commit
a605dc0
·
verified ·
1 Parent(s): f870018

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +12 -4
handler.py CHANGED
@@ -40,10 +40,18 @@ from llava.utils import disable_torch_init
40
 
41
  # Eksik fonksiyonu kendimiz tanımlıyoruz
42
  def get_model_name_from_path(model_path):
43
- """Extract model name from path"""
44
- if "/" in model_path:
45
- return model_path.split("/")[-1]
46
- return model_path
 
 
 
 
 
 
 
 
47
 
48
  # Varsayılanlar
49
  DEFAULT_CONV_MODE = os.getenv("LLAVA_CONV_MODE", "llava_v2")
 
40
 
41
  # Eksik fonksiyonu kendimiz tanımlıyoruz
42
  def get_model_name_from_path(model_path):
43
+
44
+ model_path = model_path.strip("/")
45
+
46
+ model_paths = model_path.split("/")
47
+
48
+ if model_paths[-1].startswith('checkpoint-'):
49
+
50
+ return model_paths[-2] + "_" + model_paths[-1]
51
+
52
+ else:
53
+
54
+ return model_paths[-1]
55
 
56
  # Varsayılanlar
57
  DEFAULT_CONV_MODE = os.getenv("LLAVA_CONV_MODE", "llava_v2")