Skip to main content

Using Singular Value Decomposition (SVD) to reduce the dimensionality of the trainable parameters in a neural network

Introduction

TBD

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
from svd_training.svd_model import SVDForCausalLM

filename = "mistralai/Mistral-7B-Instruct-v0.1"
tokenizer = AutoTokenizer.from_pretrained(filename)
model = AutoModelForCausalLM.from_pretrained(filename)

svd_model = SVDForCausalLM.create_from_model(model, rank_fraction=0.1) # Create the SVD model

### Train the model using your favourite training loop
...
###

svd_model.merge()  # Merge the SVD layers back into the model
svd_model.save_pretrained("svd_model/")  # Save the model

Metadata

Release files for svd-training 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for svd-training 0.0.2
File Interpreter ABI Platform
svd_training-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / svd_training-0.0.2-py3-none-any.whl

Download URL svd_training-0.0.2-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7263cf8aeda532678dd8e84ab57559033601e097e6c33b498c3c767952af7d1
BLAKE2b-256 checksum
How to use checksums
31b4d3d8bfa97c90704db405d5bcc418d1b8986283ca50af86a7451378bac9d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.10.0 requests/2.31.0 setuptools/52.0.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page