From bcea196c9da1120b5fb05daf221adceefaf35883 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 2 Mar 2023 12:03:57 -0300 Subject: [PATCH] Bump flexgen version --- requirements.txt | 2 +- server.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index a9599bb..55aeb8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ accelerate==0.16.0 bitsandbytes==0.37.0 -flexgen==0.1.6 +flexgen==0.1.7 gradio==3.18.0 numpy rwkv==0.0.6 diff --git a/server.py b/server.py index f8a7693..ed46224 100644 --- a/server.py +++ b/server.py @@ -28,7 +28,10 @@ if shared.args.settings is not None and Path(shared.args.settings).exists(): shared.settings[item] = new_settings[item] def get_available_models(): - return sorted([item.name for item in list(Path('models/').glob('*')) if not item.name.endswith(('.txt', '-np'))], key=str.lower) + 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'))], 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)