One of the problems I have when testing giant TensorFlow models in TensorFlow.js is that they're huge (like 500 MB) and they take forever to download, every time I refresh the page. This is how I setup my ServiceWorker code so that at least in testing I only have to download the model once, and then it's saved in the cache for the next time.
If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/942576182276497409
See also this gist for copying in the other direction: https://gist.github.com/CodingDoug/ffc4f050cc489a0280eb7f4cbe36af07
import json | |
import logging | |
from flask import Flask, g | |
from flask_oidc import OpenIDConnect | |
import requests | |
logging.basicConfig(level=logging.DEBUG) | |
app = Flask(__name__) |
The documentation for how to deploy a pipeline with extra, non-PyPi, pure Python packages on GCP is missing some detail. This gist shows how to package and deploy an external pure-Python, non-PyPi dependency to a managed dataflow pipeline on GCP.
TL;DR: You external package needs to be a python (source/binary) distro properly packaged and shipped alongside your pipeline. It is not enough to only specify a tar file with a setup.py
.
Your external package must have a proper setup.py
. What follow is an example setup.py
for our ETL
package. This is used to package version 1.1.1 of the etl library. The library requires 3 native PyPi packages to run. These are specified in the install_requires
field. This package also ships with custom external JSON data, declared in the package_data
section. Last, the setuptools.find_packages
function searches for all available packages and returns that
#!/bin/bash | |
# Generate a Markdown change log of pull requests from commits between two tags | |
# Author: Russell Heimlich | |
# URL: https://gist.github.com/kingkool68/09a201a35c83e43af08fcbacee5c315a | |
# HOW TO USE | |
# Copy this script to a directory under Git version control | |
# Make the script executable i.e. chmod +x changelog.sh | |
# Run it! ./changelog.sh | |
# Check CHANGELOG.md to see your results |
# starting simple HTTP server with Python in background | |
screen -d -m python -m SimpleHTTPServer 7777 | |
# killing process running with screen in background | |
kill -9 `top -n 1 | pgrep screen` |
#!/usr/bin/env bash | |
# A basic Self Signed SSL Certificate utility | |
# by Andrea Giammarchi @WebReflection | |
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network | |
# # to make it executable and use it | |
# $ chmod +x certificate | |
# $ ./certificate # to read the how-to |
// JS array equivalents to C# LINQ methods - by Dan B. | |
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version): | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, |
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |