SORSA Python Package
Initialize SORSA model:
from sorsa import SORSAConfig, SORSAModel, SORSATrainer, SORSATrainingArguments
config = SORSAConfig(
base_model_name_or_path="meta-llama/Llama-2-7b-hf",
target_modules=[
"q_proj",
"o_proj",
"k_proj",
"v_proj",
"gate_proj",
"up_proj",
"down_proj",
],
rank=16,
dropout=0,
)
sorsaModel = SORSAModel(config)
self.model.to("cuda")
self.model.sorsa_init() # Initialize SORSA adapters.
Train SORSA model:
trainingArguments = SORSATrainingArguments(
# ...
gamma=4e-4,
)
trainer = SORSATrainer(
model=sorsaModel,
args=trainingArguments,
train_dataset=train_dataset,
)
trainer.train()
Metadata
Release files for sorsa 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sorsa-1.0.1.tar.gz | 56.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sorsa-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 115.6 kB
Release files / sorsa-1.0.1.tar.gz
| Download URL | sorsa-1.0.1.tar.gz |
|---|---|
| Size | 56.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02834961b03629b705b8ddeff5a4831411b4a9f03e789b53bf4daa6d973cb741
|
|
BLAKE2b-256 checksum How to use checksums |
f2f6ebc3881c9efbc18439a273d80f8397ed58a7cf94f45ccd6a039a18c02858
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / sorsa-1.0.1-py3-none-any.whl
| Download URL | sorsa-1.0.1-py3-none-any.whl |
|---|---|
| Size | 58.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
175ccfdf9f54c1160ad64f6babf91ed6915f06d77cc8339cf6f8bdf493752414
|
|
BLAKE2b-256 checksum How to use checksums |
624c02854a54c42fed3471267ff28151f3e523728505a1562029404cbd54f01c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|