Explorar o código

Merge pull request #325 from Ph0rk0z/fix-RWKV-Names

Fix rwkv names
oobabooga %!s(int64=2) %!d(string=hai) anos
pai
achega
ffc6cb3116
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      server.py

+ 1 - 1
server.py

@@ -34,7 +34,7 @@ def get_available_models():
     if shared.args.flexgen:
         return sorted([re.sub('-np$', '', item.name) for item in list(Path('models/').glob('*')) if item.name.endswith('-np')], key=str.lower)
     else:
-        return sorted([item.name for item in list(Path('models/').glob('*')) if not item.name.endswith(('.txt', '-np', '.pt'))], key=str.lower)
+        return sorted([re.sub('.pth$', '', item.name) for item in list(Path('models/').glob('*')) if not item.name.endswith(('.txt', '-np', '.pt', '.json'))], key=str.lower)
 
 def get_available_presets():
     return sorted(set(map(lambda x : '.'.join(str(x.name).split('.')[:-1]), Path('presets').glob('*.txt'))), key=str.lower)