Skip to content

Commit d2d3e35

Browse files
authored
Merge pull request llmware-ai#1105 from llmware-ai/ov-path-setup
updating ov tokenizer path setup
2 parents 59f2c54 + d1c5f7e commit d2d3e35

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎llmware/models.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,6 +3933,14 @@ def __init__(self, model=None, tokenizer=None, model_name=None, api_key=None, mo
39333933

39343934
self.get_token_counts = OVConfig().get_config("get_token_counts")
39353935

3936+
# check for llmware path & create if not already set up
3937+
if not os.path.exists(LLMWareConfig.get_llmware_path()):
3938+
# if not explicitly set up by user, then create folder directory structure
3939+
LLMWareConfig.setup_llmware_workspace()
3940+
3941+
if not os.path.exists(LLMWareConfig.get_model_repo_path()):
3942+
os.mkdir(LLMWareConfig.get_model_repo_path())
3943+
39363944
# please note that the external tokenizer is used solely for producing
39373945
# input and output token counts - and can be switched off in OVConfig
39383946
if self.get_token_counts:
@@ -5272,6 +5280,7 @@ def __init__(self, model_name=None, api_key=None, context_window=4000, max_outpu
52725280
self.add_prompt_engineering = False
52735281
self.add_context = ""
52745282
self.prompt = ""
5283+
self.context = ""
52755284

52765285
# provides option to pass custom openai_client to model class at inference time
52775286
self.openai_client = None

‎llmware/util.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,11 @@ def load_tokenizer(self, tokenizer_fn=None):
16261626
except:
16271627
raise LLMWareException(message="Exception: requires tokenizers to be installed.")
16281628

1629+
# check for llmware path & create if not already set up
1630+
if not os.path.exists(LLMWareConfig.get_llmware_path()):
1631+
# if not explicitly set up by user, then create folder directory structure
1632+
LLMWareConfig.setup_llmware_workspace()
1633+
16291634
model_repo_path = LLMWareConfig().get_model_repo_path()
16301635

16311636
if not os.path.exists(model_repo_path):

0 commit comments

Comments
 (0)