private-llm-aws icon indicating copy to clipboard operation
private-llm-aws copied to clipboard

Select initial models and make available via TF

Open wesdottoday opened this issue 2 years ago • 1 comments

  • [ ] Look through existing models from SageMaker Jumpstart and select 2-3 embedding and text generation models
  • [ ] TF read Environment Variable (or in the TF code) to choose the models
  • [ ] TF put models on S3 bucket
  • [ ] Documentation of the models and how to update the code to support them

We need to have a few models for the users to choose from and then make them available for SageMaker inside of a S3 bucket.

wesdottoday avatar Sep 26 '23 19:09 wesdottoday

Just a snippet of code I had that informed me of the fact that there are existing models that we can copy over:

# download JumpStart model_manifest file.
boto3.client("s3").download_file(
    f"jumpstart-cache-prod-{aws_region}", "models_manifest.json", "models_manifest.json"
)
with open("models_manifest.json", "rb") as json_file:
    model_list = json.load(json_file)

# filter-out all the Text Embedding models from the manifest list.
text_embedding_models = []
for model in model_list:
    model_id = model["model_id"]
    if "-tcembedding-" in model_id and model_id not in text_embedding_models:
        text_embedding_models.append(model_id)

wesdottoday avatar Sep 26 '23 19:09 wesdottoday