Skip to content

Instantly share code, notes, and snippets.

import pickle
import cleaning
from cleaning import Process
test = open('test_pickle.pkl', 'rb')
methods = pickle.load(test)
test.close()
print(methods.__dict__)
print(methods.encode_col('ZZ'))
#cleaning.py
import pickle
import functools
import math
class Process:
def __init__(self, *args):
self.args = args
# Enable tab completion
source ~/git-completion.bash
# colors!
green="\[\033[0;32m\]"
blue="\[\033[0;34m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"
# Change command prompt
@salma71
salma71 / check_colab_allocated_GPU.ipynb
Created December 1, 2020 23:25
check the GPU memory allocation in google colab notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
HEROKU_APP_NAME=regpackage
HEROKU_APP_NAME=regpackage
COMMIT_ID=$(shell git rev-parse HEAD)
build-ml-api-heroku:
docker build --build-arg PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL} -t registry.heroku.com/$(HEROKU_APP_NAME)/web:$(COMMIT_ID) .
push-ml-api-heroku:
docker push registry.heroku.com/${HEROKU_APP_NAME}/web:$(COMMIT_ID)
version: 2
defaults: &defaults
docker:
- image: circleci/python:3.7.2
working_directory: ~/project
prepare_venv: &prepare_venv
run:
jupyter_notebooks*
*/env*
*/venv*
.circleci*
packages/regression_model
*.env
*.log
.git
.gitignore
#!/usr/bin/env bash
export IS_DEBUG=${DEBUG:-false}
exec gunicorn -b :${PORT:-5000} --access-logfile - --error-logfile - run:application
FROM python:3.6.4
# Create the user that will run the app
RUN adduser --disabled-password --gecos '' ml-api-user
WORKDIR /opt/ml_api
ARG PIP_EXTRA_INDEX_URL
ENV FLASK_APP run.py
from marshmallow import Schema, fields
from marshmallow import ValidationError
import typing as t
import json
class InvalidInputError(Exception):
"""Invalid model input."""