Welcome to the AI Explainer Models!
This repository hosts our language models fine-tuned to explain Cardano smart contracts.
For details about the interface for visualizing and browsing the contracts, visit:
AI Smart Contract Explainer Interface.
The first version (V1) of our smart contract explainer model is available on Hugging Face:
unboundedmarket/smart_contract_explainer_open_llama_7b_v2
This model is based on the fine-tuned Open Llama 7B V2.
You can find the base model here:
Open Llama 7B V2
The fine-tuning was performed on a dateset of Cardano smart contracts using Axolotl on an NVIDIA L40 GPU.
Clone this repository:
git clone https://github.com/unboundedmarket/ai-sc-explainer-models.git
cd ai-sc-explainer-models
Ensure you have all dependencies installed by running:
pip install -r requirements.txt
You can directly load the model using the following code snippet:
from transformers import LlamaTokenizer, LlamaForCausalLM
model_path = "unboundedmarket/smart_contract_explainer_open_llama_7b_v2"
tokenizer = LlamaTokenizer.from_pretrained(model_path)
model = LlamaForCausalLM.from_pretrained(
model_path, torch_dtype=torch.float16, device_map="auto"
)
For an example of how to generate explanations for Cardano smart contracts, see:
src/script/inference.py
The model was fine-tuned using a dataset of Cardano smart contracts. The training data is available in:
src/data/train_dataset.jsonl