Skip to content

Instantly share code, notes, and snippets.

Dwight Gunning dgunning

Block or report user

Report or block dgunning

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dgunning
dgunning / BertFinetuning
Last active Oct 27, 2019
An example of finetuning a language model using the Huggingface Transformer library
View BertFinetuning
mkdir -p output
# Install Transformers
pip install transformers
# Download the wikitext raw data files
if [ ! -d "wikitext-2-raw" ];
then
wget https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-2-raw-v1.zip
unzip wikitext-2-raw-v1.zip
fi
@dgunning
dgunning / DataFrameHolder
Created Oct 22, 2019
A delegate class for pandas dataframes .. an alternative to subclassing pandas dataframes
View DataFrameHolder
import pandas as pd
class DataFrameHolder:
def __init__(self, data: pd.DataFrame, title=''):
self.data = data
self.title = title
def __len__(self):
return len(self.data)
View gist:9bc4e8711f240e3884460abfd83dbdd7
/**
* Gets an HTTP resource
* @param url the url
* @return an InputStream from the resource
*/
public static InputStream get(String url){
HttpClient client = HttpClientBuilder.create().build();
try {
return client.execute( new HttpGet(url)).getEntity().getContent();
} catch (IOException e) {
@dgunning
dgunning / SQLTempate.java
Last active Dec 18, 2017
A template for creating a new insert statement from an existing one in Java
View SQLTempate.java
package com.dgunning.testtools.sql;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.IntStream;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toMap;
You can’t perform that action at this time.