Skip to content

Atqy/refactor music recommendation #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CI corrections
  • Loading branch information
atqy committed May 5, 2022
commit 7d9f91a97793840fce9b5a5d751c0cd74168f9c3
2 changes: 1 addition & 1 deletion end_to_end/music_recommendation/01_data_exploration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"metadata": {},
"outputs": [],
"source": [
"pretrained_model_path = get_model('./model/model.tar.gz', bucket)"
"pretrained_model_path = get_model('./model/model.tar.gz', bucket, prefix)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@
"metadata": {},
"outputs": [],
"source": [
"local_explanations_out = pd.read_csv(explainability_output_path+'/explanations_shap/out.csv')\n",
"s3_client.download_file(bucket, f\"{prefix}/clarify-output/explainability/explanations_shap/out.csv\", f\"out.csv\")\n",
"local_explanations_out = pd.read_csv('out.csv')\n",
"local_explanations_out.columns = feature_names\n",
"\n",
"print(\"Model prediction:\", playlist.iloc[0, 0])\n",
Expand Down
8 changes: 4 additions & 4 deletions end_to_end/music_recommendation/code/demo_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def get_data(s3_client, public_s3_data, to_bucket, to_prefix, sample_data=1):
return new_paths


def get_model(model_path, to_bucket):
def get_model(model_path, to_bucket, to_prefix):
# upload model to our default s3 bucket for SageMaker Studio
filename = model_path.split('/')[-1]
print("Uploading {} to {}\n".format(model_path, os.path.join(to_bucket,prefix,filename)))
s3_client.upload_file(model_path, to_bucket, os.path.join(prefix,filename))
return "s://{}".format(os.path.join(to_bucket,prefix,filename))
print("Uploading {} to {}\n".format(model_path, os.path.join(to_bucket,to_prefix,filename)))
s3_client.upload_file(model_path, to_bucket, os.path.join(to_prefix,filename))
return "s://{}".format(os.path.join(to_bucket,to_prefix,filename))


def update_data_sources(flow_path, tracks_data_source, ratings_data_source):
Expand Down
1 change: 1 addition & 0 deletions end_to_end/music_recommendation/end_to_end_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"\n",
"account_id = boto3.client('sts').get_caller_identity()[\"Account\"]\n",
"\n",
"sess = sagemaker.Session()\n",
"bucket = sess.default_bucket()\n",
"prefix='music-recommendation'"
]
Expand Down