mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Merge branch 'UI2' of https://github.com/ebolam/KoboldAI into UI2
This commit is contained in:
@@ -1095,7 +1095,10 @@ def get_layer_count(model, directory=""):
|
|||||||
else:
|
else:
|
||||||
from transformers import AutoConfig
|
from transformers import AutoConfig
|
||||||
if directory == "":
|
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):
|
elif os.path.isdir(directory):
|
||||||
model_config = AutoConfig.from_pretrained(directory, cache_dir="cache")
|
model_config = AutoConfig.from_pretrained(directory, cache_dir="cache")
|
||||||
else:
|
else:
|
||||||
|
@@ -121,7 +121,7 @@ class koboldai_vars(object):
|
|||||||
def calc_ai_text(self):
|
def calc_ai_text(self):
|
||||||
token_budget = self.max_length
|
token_budget = self.max_length
|
||||||
used_world_info = []
|
used_world_info = []
|
||||||
used_tokens = 0
|
used_tokens = self.sp_length
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
self.worldinfo_v2.reset_used_in_game()
|
self.worldinfo_v2.reset_used_in_game()
|
||||||
@@ -845,7 +845,10 @@ class KoboldStoryRegister(object):
|
|||||||
self.set_game_saved()
|
self.set_game_saved()
|
||||||
|
|
||||||
def set_action_in_ai(self, action_id, used=True):
|
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
|
self.actions[action_id]['In AI Input'] = used
|
||||||
if old != 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)
|
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