Skip to content

Instantly share code, notes, and snippets.

View ravenscroftj's full-sized avatar

James Ravenscroft ravenscroftj

View GitHub Profile
@ravenscroftj
ravenscroftj / minimal_continue_groq_config.md
Created April 28, 2024 08:46
Minimal Groq + Continue.Dev Recipe

Minimal continue.dev Groq Config

{
  "models": [
    {
      "title":"Groq Llama 8b",
      "provider":"openai",
      "model": "llama3-8b-8192",
      "apiBase": "https://api.groq.com/openai/v1",
 "apiKey": "",
#%%
from audioop import mul
import json
from statistics import mean
from typing import List
from matplotlib.pyplot import cla
from requests import delete
import spacy
from spacy import matcher
import torch
@ravenscroftj
ravenscroftj / train.py
Created December 29, 2020 14:22
MLFlow + NLP Training script using TFIDF and Random Forest on 20 newsgroups
#!/usr/bin/env python
# coding: utf-8
import mlflow
import mlflow.sklearn
import json
import os
import tempfile
import pandas as pd
@ravenscroftj
ravenscroftj / unpaywall.py
Created April 13, 2018 15:50
Python Unpaywall Wrapper
"""
Simple function wrapper for the unpaywall API.
"""
import requests
YOUR_EMAIL = "test@gmail.com" # you should put your own email address here
def unpaywall(doi, retry=0, pdfonly=True):
"""Find legal open access version of paper"""
import csv
import sys
import argparse
import random
def main():
ap = argparse.ArgumentParser(description="Split your NLC groundtruth into test and train data")
ap.add_argument("gtfile", help="Ground truth CSV file")
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Citation classifier excite\n",
"\n",
"\n",
"GIT repo: `git clone git@nopro.be:james/excite.git` \n",
class WatsonSTT(AbstractSTTEngine):
""" Watson Speech-To-Text implementation
"""
SLUG = "watson"
def __init__(self, app_username, app_password):
self._logger = logging.getLogger(__name__)
self._session = None
self._cookies = []
from __future__ import print_function
import elasticsearch
from itertools import chain
#scroll pointer timeout in minutes 1 minute is usually fine but you can increase if you get timeout errors
TIMEOUT = "1m"
def scrollr(client, scroll_id, f):

Keybase proof

I hereby claim:

  • I am ravenscroftj on github.
  • I am ravenscroftj (https://keybase.io/ravenscroftj) on keybase.
  • I have a public key ASAytjzPSSzbpBFFSqymW2A-iAEwLc6PFVkpz9TUfsNpigo

To claim this, I am signing this object:

pub fn testfn(){
info!("I am a tree");
}