Skip to content

Instantly share code, notes, and snippets.

View tomsherborne's full-sized avatar
🦊

Tom Sherborne tomsherborne

🦊
View GitHub Profile
"(\w*)\.(\w*)\s(?:[=<>]{1,2})\s\'?(\w*)\'?"
(\w*)\.(\w*)\s([=<>]{1,2})\s(?:\'|\")?(\w*\.?(?! AND) ?\w*)(?:\'|\")?
(\w*)\.(\w*)\s([=<>]{1,2})\s(?:\'|\")?(\w*\.?(?! (?:AND|OR)) ?\w*)(?:\'|\")?
splits="444 555"
locales="fr pt es de zh"
samples="01 05 10 20 50"
for sp in $splits;
do echo $sp;
for loc in $locales;
do echo $loc;
for sample in $samples;
do echo $sample;
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
source ~/miniconda3/bin/activate allen
LANG=en
TASK=qa_en_small
for SPLIT in train valid
do
python -m examples.roberta.multiprocessing_bpe_encoder \
--encoder-json encoder.json \
--vocab-bpe vocab.bpe \
--inputs "$TASK/$SPLIT.$LANG" \
fairseq-train qa_en_small-bin \
--log-interval=10 \
--log-format=json \
--tensorboard-logdir=/users/tom/ed/sp/pretrain/tests/fairseq/bart_en_small/logs \
--seed=1 \
--cpu \
--min-loss-scale=0.0001 \
--model-parallel-size=1 \
--criterion=cross_entropy \
ENV_NAME='name'
conda activate $ENV_NAME
python -m ipykernel install --user --name $ENV_NAME
# Make sure the port is allowed for SSH on the server
REMOTE_PORT=1234
LOCAL_PORT=1234
USER=""
MACHINE=""
ssh -N -L localhost:${REMOTE_PORT}:localhost:${LOCAL_PORT} ${USER}@${MACHINE}.inf.ed.ac.uk
### James Owers port forwarding setup
local_port=1234
remote_port=1234
@tomsherborne
tomsherborne / sensecheck.sh
Last active October 31, 2017 16:31
Sense check for LaTeX documents [WIP]
detex main.tex | grep 'the the\|had had\|we we\|And\|is is\|to the'
@tomsherborne
tomsherborne / gcfdata.m
Last active September 14, 2017 12:27
Pulling data from a Matlab plot
h = findobj(gca,'Type','Line');
xd = get(h,'XData');
yd = get(h,'YData');
if iscell(xd) && iscell(yd) % Multi plot object
exprt = NaN*ones(length(yd{1}),length(yd)+1);
exprt(:,1) = xd{1};
for i = 1:length(yd)
exprt(:,i+1) = yd{i};
end
else % Single plot object