Skip to content

hammer-hao/SpellCrafted

Repository files navigation

SpellCrafted: Your Custom MTG Card Conjurer

What is SpellCrafted?

Spellcrafted is a small language model trained with ~25,000 cards ever printed in Magic: The Gathering. It has 10 million parameters, and specializes at generating card texts with any given card game as prompt!

How does it work?

When you input any arbitrary card name to the model, it first gets lammentized and converted into a vector using Word2Vec. This vector gets passed down to multiple networks. It gets passed into multiple classification networks to determine the color, mana cost, and type of your card. It gets passed into a tranformer decoder which sequentially generates output tokens for card text.

For the transformer decoder, we trained our own tokenizers using the 🤗 Tokenizers implementation.

Who made SpellCrafted?

The model architecture for SpellCrafted was conjured by human planeswalker Zihe Hao. Training was done on a RTX4090 owned by Yuan Zhai. Human engineer Jianpeng Yin developed the frontend website.

How do I train this model on my own?

The card text data we used are readily available at Scryfall API. There exists card data files for all languages the cards are available in. You can train the model in another language or even train a card text translator!

About

SpellCrafted: Your Custom MTG Card Conjurer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published