Skip to content

Instantly share code, notes, and snippets.

View shivammehta25's full-sized avatar
:octocat:
this animal in his natural habitat

Shivam Mehta shivammehta25

:octocat:
this animal in his natural habitat
View GitHub Profile
@shivammehta25
shivammehta25 / train.py
Created September 27, 2024 14:34
This is Matcha's train.py if you only want to load weights from the checkpoint and not the optimizer's states.
from typing import Any, Dict, List, Optional, Tuple
import hydra
import lightning as L
import rootutils
from lightning import Callback, LightningDataModule, LightningModule, Trainer
from lightning.pytorch.loggers import Logger
from omegaconf import DictConfig
from matcha import utils
@shivammehta25
shivammehta25 / Hosting_models.py
Created November 13, 2022 10:10
Hosting the models on the server using FastAPI
import json
import sys
sys.path.append('src/model')
sys.path.insert(0, './hifigan')
import logging
import os
from pathlib import Path
from uuid import uuid4
@shivammehta25
shivammehta25 / assignment_6_data.json
Last active January 29, 2023 21:26
Assignement 6 data json
{"part_1": {"A": [1.3289685530035618, 1.1651508061381441, 0.7631653476434284, 0.7102941367492636, 0.7141679022121673, 0.9238686165977774, 2.3763289731759945, 1.1728786644866258, 1.5456303986453817, 1.8307110056560796, 0.913641029695185, 0.3207673213283985, 0.6982080749901575, 0.5670384444667927, 0.7984430401385789, 1.056119262388202, 0.717912595855595, 0.5407891112112009, 1.2139131032609538, 1.1906981592748638, 0.7620391245275789, 1.2215988439841174, 1.217804178741637, 1.103111401233095, 0.9365024928859879, 0.553753928583847, 1.526739841606898, 1.4365889644652245, 0.5164525170951063, 0.4446933188187261, 1.700690373005282, 0.9638603458167805, 0.3561246811785101, 1.0794693257439627, 0.7851324510567355, 0.9814201784580446, 0.6218411329885448, 0.5055394878957932, 0.8390436164413066, 0.9053144463446685, 1.2545495866181842, 1.0273653388297026, 0.5370219778704626, 1.3592395313686898, 0.5619163183773729, 1.106004444823451, 0.34593604357115293, 0.6020707771557747, 0.6725565913440426, 0.633786011459005, 1.1367306336009
@shivammehta25
shivammehta25 / helperfile.py
Created January 19, 2022 09:07
Helperfile for the second programming assignment
from scipy.stats import multivariate_normal
import numpy as np
import matplotlib.pyplot as plt
from collections import namedtuple
import random
import numpy as np
from sklearn.datasets import make_blobs
from matplotlib.colors import ListedColormap
from math import ceil, floor
from matplotlib import cm, gridspec