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

Method load_sample_files

llmware/setup.py:75–103  ·  view source on GitHub ↗

Downloads sample document files from non-restricted AWS S3 bucket.

(over_write=False)

Source from the content-addressed store, hash-verified

73 """
74 @staticmethod
75 def load_sample_files(over_write=False):
76
77 """ Downloads sample document files from non-restricted AWS S3 bucket. """
78
79 if not os.path.exists(LLMWareConfig.get_llmware_path()):
80 LLMWareConfig.setup_llmware_workspace()
81
82 # not configurable - will pull into /sample_files under llmware_path
83 sample_files_path = os.path.join(LLMWareConfig.get_llmware_path(), "sample_files")
84
85 if not os.path.exists(sample_files_path):
86 os.makedirs(sample_files_path,exist_ok=True)
87 else:
88 if not over_write:
89 logger.info(f"Setup - sample_files path already exists - {sample_files_path}")
90 return sample_files_path
91
92 # pull from sample files bucket
93 logger.info(f"Setup - sample_files - downloading requested sample files from AWS S3 bucket - may take a minute.")
94
95 bucket_name = LLMWareConfig().get_config("llmware_sample_files_bucket")
96 remote_zip = bucket_name + ".zip"
97 local_zip = os.path.join(sample_files_path, bucket_name + ".zip")
98
99 CloudBucketManager().pull_file_from_public_s3(remote_zip, local_zip, bucket_name)
100 shutil.unpack_archive(local_zip, sample_files_path, "zip")
101 os.remove(local_zip)
102
103 return sample_files_path
104
105 @staticmethod
106 def load_voice_sample_files(over_write=False, small_only=True):

Callers 15

embeddings_fast_startFunction · 0.80
build_libFunction · 0.80
build_libFunction · 0.80
ragFunction · 0.80
set_up_agreementsFunction · 0.80
setup_libraryFunction · 0.80
build_libFunction · 0.80
build_libFunction · 0.80
embeddings_lancedbFunction · 0.80

Calls 6

LLMWareConfigClass · 0.90
CloudBucketManagerClass · 0.90
get_llmware_pathMethod · 0.80
get_configMethod · 0.45