mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix
This commit is contained in:
@@ -1095,7 +1095,10 @@ def get_layer_count(model, directory=""):
|
||||
else:
|
||||
from transformers import AutoConfig
|
||||
if directory == "":
|
||||
model_config = AutoConfig.from_pretrained(model, cache_dir="cache")
|
||||
if os.path.isdir("./models/{}".format(model.replace("/", "_"))):
|
||||
model_config = AutoConfig.from_pretrained("./models/{}".format(model.replace("/", "_")), cache_dir="cache")
|
||||
else:
|
||||
model_config = AutoConfig.from_pretrained(model, cache_dir="cache")
|
||||
elif os.path.isdir(directory):
|
||||
model_config = AutoConfig.from_pretrained(directory, cache_dir="cache")
|
||||
else:
|
||||
|
@@ -121,7 +121,7 @@ class koboldai_vars(object):
|
||||
def calc_ai_text(self):
|
||||
token_budget = self.max_length
|
||||
used_world_info = []
|
||||
used_tokens = 0
|
||||
used_tokens = self.sp_length
|
||||
text = ""
|
||||
|
||||
self.worldinfo_v2.reset_used_in_game()
|
||||
@@ -845,7 +845,10 @@ class KoboldStoryRegister(object):
|
||||
self.set_game_saved()
|
||||
|
||||
def set_action_in_ai(self, action_id, used=True):
|
||||
old = self.actions[action_id]['In AI Input']
|
||||
if 'In AI Input' in self.actions[action_id]:
|
||||
old = self.actions[action_id]['In AI Input']
|
||||
else:
|
||||
old = None
|
||||
self.actions[action_id]['In AI Input'] = used
|
||||
if old != used:
|
||||
process_variable_changes(self.socketio, "actions", 'In AI Input', {"id": action_id, 'In AI Input': self.actions[action_id]["In AI Input"]}, None)
|
||||
|
Reference in New Issue
Block a user