File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -282,11 +282,18 @@ def get_vllm_version():
282282
283283    if  __version__  ==  "dev" :
284284        return  "N/A (dev)" 
285- 
286-     if  len (__version_tuple__ ) ==  4 :  # dev build 
287-         git_sha  =  __version_tuple__ [- 1 ][1 :]  # type: ignore 
288-         return  f"{ __version__ } { git_sha }  
289- 
285+     version_str  =  __version_tuple__ [- 1 ]
286+     if  isinstance (version_str , str ) and  version_str .startswith ('g' ):
287+         # it's a dev build 
288+         if  '.'  in  version_str :
289+             # it's a dev build containing local changes 
290+             git_sha  =  version_str .split ('.' )[0 ][1 :]
291+             date  =  version_str .split ('.' )[- 1 ][1 :]
292+             return  f"{ __version__ } { git_sha } { date }  
293+         else :
294+             # it's a dev build without local changes 
295+             git_sha  =  version_str [1 :]  # type: ignore 
296+             return  f"{ __version__ } { git_sha }  
290297    return  __version__ 
291298
292299
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments