Skip to content

Instantly share code, notes, and snippets.

View sai-prasanna's full-sized avatar
🤖
=42

Sai Prasanna sai-prasanna

🤖
=42
View GitHub Profile
import streamlit as st
import numpy as np
from lmproof.scorer import TransformerLMScorer
from lmproof.candidate_generators import (MatchedGenerator,
EnglishInflectedGenerator,
SpellCorrectGenerator)
@st.cache(ignore_hash=True)
def model():
@sai-prasanna
sai-prasanna / hub_batched.py
Last active July 18, 2021 17:52
Hub fairseq translate batched
from collections import namedtuple
from typing import Any, List, Iterator, Tuple
import torch
import copy
class FairseqHubInferer:
"""
@sai-prasanna
sai-prasanna / install.sh
Last active April 10, 2020 23:14
Reverse Engineer SpaCy Patterns - Pattern Matching
pip install git+https://github.com/sai-prasanna/spacy-pattern-builder.git
pip install streamlit
python -m spacy download en # Or any other model you wish to use.
streamlit run streamlit_pattern_builder.py
@sai-prasanna
sai-prasanna / collisionLSH.py
Created August 8, 2021 17:01 — forked from unrealwill/collisionLSH.py
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()