MCPcopy
hub / github.com/llmware-ai/llmware / setup_llmware_workspace

Method setup_llmware_workspace

llmware/configs.py:271–322  ·  view source on GitHub ↗

Set up llmware main working folder directory

(cls)

Source from the content-addressed store, hash-verified

269
270 @classmethod
271 def setup_llmware_workspace (cls):
272
273 """Set up llmware main working folder directory"""
274
275 # create file structure - configured through use of env variable ["HOME"]
276 home_path = cls._base_fp["home_path"]
277
278 if not os.path.exists(home_path):
279 raise LLMWareException(message=f"LLMWareConfig - get_path - could not find home path - {home_path}")
280
281 llmware_path = cls.get_llmware_path()
282 if not os.path.exists(llmware_path):
283 os.mkdir(llmware_path)
284
285 library_path = cls.get_library_path()
286 if not os.path.exists(library_path):
287 os.mkdir(library_path)
288
289 input_path = cls.get_input_path()
290 if not os.path.exists(input_path):
291 os.mkdir(input_path)
292
293 model_repo_path = cls.get_model_repo_path()
294 if not os.path.exists(model_repo_path):
295 os.mkdir(model_repo_path)
296
297 parser_path = cls.get_parser_path()
298 if not os.path.exists(parser_path):
299 os.mkdir(parser_path)
300
301 query_path = cls.get_query_path()
302 if not os.path.exists(query_path):
303 os.mkdir(query_path)
304
305 prompt_path = cls.get_prompt_path()
306 if not os.path.exists(prompt_path):
307 os.mkdir(prompt_path)
308
309 tmp_path = cls.get_tmp_path()
310 if not os.path.exists(tmp_path):
311 os.mkdir(tmp_path)
312
313 # set 'open' read/write directory permissions, e.g., chmod 777
314 os.chmod(library_path, 0o777)
315 os.chmod(input_path, 0o777)
316 os.chmod(model_repo_path, 0o777)
317 os.chmod(parser_path, 0o777)
318 os.chmod(query_path, 0o777)
319 os.chmod(prompt_path, 0o777)
320 os.chmod(tmp_path, 0o777)
321
322 return 0
323
324 @classmethod
325 def create_new_account(cls, account_name):

Callers 15

__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
prepare_local_modelMethod · 0.80

Calls 9

LLMWareExceptionClass · 0.85
get_llmware_pathMethod · 0.80
get_library_pathMethod · 0.80
get_input_pathMethod · 0.80
get_model_repo_pathMethod · 0.80
get_parser_pathMethod · 0.80
get_query_pathMethod · 0.80
get_prompt_pathMethod · 0.80
get_tmp_pathMethod · 0.80

Tested by 1