Downloads · 30 days
121
5% of all-time downloads
RichardErkhov/GusPuffy_-_sentient-simulations-pydecompiler-3.7-6.7b-v0.9-gguf
GusPuffy_-_sentient-simulations-pydecompiler-3.7-6.7b-v0.9-gguf is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
121
5% of all-time downloads
All-time downloads
2.3K
Public
Repo size
67.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf79.9 GB · 100%
From the Hugging Face model README
Quantization made by Richard Erkhov.
sentient-simulations-pydecompiler-3.7-6.7b-v0.9 - GGUF
license: other license_name: deepseek-license license_link: LICENSE tags:
The Sentient Simulations AI Python Decompiler is a deepseek-ai/deepseek-coder-6.7b-base finetune for the specific task of decompiling Python 3.7 bytecode back to its original Python source code.
The Sentient Simulations AI Python Decompiler data used Python 3.7 source code that was then compiled to bytecode. The bytecode was used as the input and the source code was used as the output to teach the model how to generate the original source code from Python bytecode. Below are the steps to prepare the data.
The model was trained for 4 days on 3x3090s using Deepspeed Zero 3 Offload at 16k context.
conda create -n pydecompiler-37 python=3.7 -y
conda create -n pydecompiler-310 python=3.10 -y
conda activate pydecompiler-310
pip install huggingface-hub
mkdir pydecompiler
cd pydecompiler
huggingface-cli download GusPuffy/sentient-simulations-pydecompiler-3.7-6.7b-v0.9 --local-dir . --local-dir-use-symlinks False --include "*.py"
huggingface-cli download GusPuffy/sentient-simulations-pydecompiler-3.7-6.7b-v0.9-GGUF --local-dir . --local-dir-use-symlinks False --include "sentient-simulations-pydecompiler-3.7-6.7b-v0.9-q8_0.gguf"
conda activate pydecompiler-37
python bytecode.py bytecode.py > bytecode-decompiled.pycb
conda activate pydecompiler-310
python decompile.py bytecode-decompiled.pycb
If you have a bunch of files you want to decompile, you can run the following command to decompile the entire directory.
conda activate pydecompiler-37
python convert_pyc_to_bytecode.py directory_with_files
conda activate pydecompiler-310
python decompile.py directory_with_files
Note that files over 15k token count are skipped. Files over 10k will most likely be truncated due to the context limit.
At the end of the decompiled source code is a note if the context limit was reached or the AI decided it was complete:
# Finish Reason: stop
# Finish Reason: length
The dataset has shown pretty amazing results for decompiling files under 16k context using only a 7b model.
I would like to train a larger context model or the 34b version of deepseek coder.
Let me know if you have compute available and you are interested in training a longer context version of this tool!
This is a fune tune of deepseek so checkout their license LICENSE-MODEL for more details.
If you have any questions, please raise an issue or find me on discord