Skip to content

Instantly share code, notes, and snippets.

View ToluClassics's full-sized avatar
🏠
Working from home

Ogundepo Odunayo ToluClassics

🏠
Working from home
View GitHub Profile
@ToluClassics
ToluClassics / knn_elasticsearch.py
Last active February 17, 2023 08:47
KNN Nearest Neighbour Search in ElasticSearch
import os
import json
from tqdm import tqdm
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModel
from elasticsearch import Elasticsearch
class JsonlCollectionIterator:
@ToluClassics
ToluClassics / assessment.ipynb
Created December 14, 2022 18:05
Customer Response Clustering
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ToluClassics
ToluClassics / lib.rs
Created May 30, 2023 00:36 — forked from JosephCatrambone/lib.rs
Embedding GPT-2 in Godot via Rust
mod ml_thread;
use gdnative::prelude::{godot_print, methods, Method, NativeClass, Node as GDNode, InitHandle, godot_init};
use ml_thread::start_language_model_thread;
use std::sync::mpsc::{channel, Receiver, RecvError, Sender, SendError};
const MAX_INPUT_LENGTH: usize = 512;
const BATCH_SIZE: usize = 1;
@ToluClassics
ToluClassics / embedding.rs
Last active July 26, 2023 04:13
Bert in Rust
use std::borrow::Borrow;
use tch::nn::ModuleT;
use tch::nn::{self};
use tch::{Kind, Tensor};
#[derive(Debug)]
pub struct Dropout {
dropout_prob: f64,
}