Skip to content

Instantly share code, notes, and snippets.

# ====================== GENERAL ======================
# Import additional configuration files
# import = []
# The path of your favorite shell
[shell]
# Example
program = "/bin/zsh"
args = ["-l"]
@nsakki55
nsakki55 / rename_flow.py
Last active July 1, 2023 13:59
rename custom flow run name for prefect 2.0
import asyncio
from datetime import datetime
import prefect
from prefect import flow, task
@task(name="set flow run name task")
async def set_flow_run_name(name: str) -> None:
"""Set user specify flow run name."""
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FROM python:3.6-slim-buster
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc g++
RUN pip3 install pandas numpy joblib scikit-learn cython
RUN pip3 install fastFM
ADD scratch_container/scratch_container_training_script.py scratch_container_training_script.py
from __future__ import absolute_import
import json
import os
import sys
import joblib
import numpy as np
import pandas as pd
from fastFM.mcmc import FMClassification
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FROM python:3.6-slim-buster
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc g++
RUN pip3 install pandas numpy joblib scikit-learn cython
RUN pip3 install fastFM
RUN pip3 install sagemaker-training
ADD custom_toolkit_container/custom_toolkit_container_training_script.py /opt/ml/code/custom_toolkit_container_training_script.py
import argparse
import os
import joblib
import numpy as np
import pandas as pd
from fastFM.mcmc import FMClassification
from sagemaker_training import environment
from sklearn.metrics import log_loss
from sklearn.preprocessing import OneHotEncoder
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
%%sh
# Specify an algorithm name
algorithm_name=$1
dockerfiler=$2
account=$(aws sts get-caller-identity --query Account --output text)
# Get the region defined in the current configuration (default to us-west-2 if none defined)