Skip to content

Instantly share code, notes, and snippets.

@crypt3lx2k
crypt3lx2k / 0-model.py
Last active September 2, 2021 07:59
Training model in tensorflow for tflite with 8-bit integer quantization
#! /usr/bin/env python
import tensorflow as tf
def inference_fn(x, training=False):
net = x
net = tf.layers.flatten(net)
net = tf.layers.dense(net, 512, activation=tf.nn.relu)
net = tf.layers.dropout(net, 0.2, training=training)
@W4ngatang
W4ngatang / download_glue_data.py
Last active May 23, 2024 12:55
Script for downloading data of the GLUE benchmark (gluebenchmark.com)
''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParaphraseCorpus.msi) and extract the data from it manually.
For Windows users, you can run the .msi file. For Mac and Linux users, consider an external library such as 'cabextract' (see below for an example).
You should then rename and place specific files in a folder (see below for an example).
mkdir MRPC
cabextract MSRParaphraseCorpus.msi -d MRPC
@shagunsodhani
shagunsodhani / PPDB.md
Created March 5, 2017 17:27
Summary of "PPDB: The Paraphrase Database" paper

PPDB: The Paraphrase Database

Introduction

  • The paper presents a database of ranked English and Spanish paraphrases derived by:
    • Extracting lexical, phrasal, and syntactic paraphrases from large bilingual parallel corpora.
    • Computing the similarity scores for the pair of paraphrases using Google ngrams and the Annotated Gigaword corpus.
  • Link to the paper

Extracting Paraphrase from Bilingual Text

@subfuzion
subfuzion / mysql-autostart-osx.md
Created March 18, 2014 22:39
mysql auto start on OS X

Install with Homebrew

brew install mysql

Set up launchctl to auto start mysql

$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

/usr/local/opt/mysql/ is a symlink to /usr/local/Cellar/mysql/x.y.z (e.g., 5.6.16)

@chrisjhoughton
chrisjhoughton / wait-el.js
Last active October 6, 2023 09:46
Wait for an element to exist on the page with jQuery
var waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {
waitForEl(selector, callback);
}, 100);
}
};
@fabiofl
fabiofl / gist:5873100
Created June 27, 2013 00:41
Clear Mac OS X's icon cache.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 27, 2024 16:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@zythum
zythum / gist:2848881
Created June 1, 2012 04:50
google收录的敏感词