Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A collection of tricks to speed up LLMs, see our transformer-tricks papers on arXiv
pip3 install transformer-tricks
The example below converts SmolLM-135M to FlashNorm and measures perplexity of the original and the modified model.
import transformer_tricks as tt
# convert model and store the new model in ./SmolLM-135M_flashNorm_test
tt.flashify_repo('HuggingFaceTB/SmolLM-135M')
# run example inference of original and modified model
tt.hello_world('HuggingFaceTB/SmolLM-135M')
tt.hello_world('./SmolLM-135M_flashNorm_test')
# measure perplexity of original and modified model
tt.perplexity('HuggingFaceTB/SmolLM-135M', speedup=16)
tt.perplexity('./SmolLM-135M_flashNorm_test', speedup=16)
Results:
Once upon a time there was a curious little girl
Once upon a time there was a curious little girl
perplexity = 16.083
perplexity = 16.083
You can run the example in your browser by clicking on this notebook: . Hit "cancel" when it says "Notebook does not have secret access", because we don't need an HF_TOKEN for SmolLM.
# setup
git clone https://github.com/OpenMachine-ai/transformer-tricks.git
cd python
pip3 install --quiet -r requirements.txt
# run tests
python3 flashNorm_test.py
Results:
Once upon a time there was a curious little girl
Once upon a time there was a curious little girl
Once upon a time there was a little girl named
Once upon a time there was a little girl named
perplexity = 16.083
perplexity = 16.083
perplexity = 12.086
perplexity = 12.086
To run llama and other LLMs that need an agreement (not SmolLM), you first have to type the following, which will ask for your hf_token
:
huggingface-cli login
Before making a change to this repo, please do the following:
autopep8 *.py
. It's using the config in pyproject.toml
.transformer_tricks.py
, publish a new version of the package as follows:
pyproject.toml
and in requirements.txt
./push_pypi.sh
flashNorm_example.py
, generate the corresponding notebook as follows:
jupytext --to ipynb flashNorm_example.py -o ../notebooks/flashNorm_example.ipynb
FAQs
A collection of tricks to speed up LLMs, see our transformer-tricks papers on arXiv
We found that transformer-tricks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.