Instructions to use minimaxir/magic-the-gathering with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use minimaxir/magic-the-gathering with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="minimaxir/magic-the-gathering")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("minimaxir/magic-the-gathering") model = AutoModelForCausalLM.from_pretrained("minimaxir/magic-the-gathering", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use minimaxir/magic-the-gathering with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "minimaxir/magic-the-gathering" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "minimaxir/magic-the-gathering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/minimaxir/magic-the-gathering
- SGLang
How to use minimaxir/magic-the-gathering with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "minimaxir/magic-the-gathering" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "minimaxir/magic-the-gathering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "minimaxir/magic-the-gathering" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "minimaxir/magic-the-gathering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use minimaxir/magic-the-gathering with Docker Model Runner:
docker model run hf.co/minimaxir/magic-the-gathering
| {"version":"1.0","truncation":null,"padding":null,"added_tokens":[{"id":0,"special":true,"content":"<|endoftext|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":1,"special":true,"content":"<|name|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":2,"special":true,"content":"<|manaCost|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":3,"special":true,"content":"<|type|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":4,"special":true,"content":"<|text|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":5,"special":true,"content":"<|power|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":6,"special":true,"content":"<|toughness|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false},{"id":7,"special":true,"content":"<|loyalty|>","single_word":false,"lstrip":false,"rstrip":false,"normalized":false}],"normalizer":null,"pre_tokenizer":{"type":"ByteLevel","add_prefix_space":false,"trim_offsets":true},"post_processor":{"type":"ByteLevel","add_prefix_space":true,"trim_offsets":true},"decoder":{"type":"ByteLevel","add_prefix_space":true,"trim_offsets":true},"model":{"type":"BPE","dropout":null,"unk_token":null,"continuing_subword_prefix":null,"end_of_word_suffix":null,"fuse_unk":false,"vocab":{"<|endoftext|>":0,"<|name|>":1,"<|manaCost|>":2,"<|type|>":3,"<|text|>":4,"<|power|>":5,"<|toughness|>":6,"<|loyalty|>":7,"!":8,"\"":9,"#":10,"$":11,"%":12,"&":13,"'":14,"(":15,")":16,"*":17,"+":18,",":19,"-":20,".":21,"/":22,"0":23,"1":24,"2":25,"3":26,"4":27,"5":28,"6":29,"7":30,"8":31,"9":32,":":33,";":34,"<":35,"=":36,">":37,"?":38,"@":39,"A":40,"B":41,"C":42,"D":43,"E":44,"F":45,"G":46,"H":47,"I":48,"J":49,"K":50,"L":51,"M":52,"N":53,"O":54,"P":55,"Q":56,"R":57,"S":58,"T":59,"U":60,"V":61,"W":62,"X":63,"Y":64,"Z":65,"[":66,"\\":67,"]":68,"^":69,"_":70,"`":71,"a":72,"b":73,"c":74,"d":75,"e":76,"f":77,"g":78,"h":79,"i":80,"j":81,"k":82,"l":83,"m":84,"n":85,"o":86,"p":87,"q":88,"r":89,"s":90,"t":91,"u":92,"v":93,"w":94,"x":95,"y":96,"z":97,"{":98,"|":99,"}":100,"~":101,"¡":102,"¢":103,"£":104,"¤":105,"¥":106,"¦":107,"§":108,"¨":109,"©":110,"ª":111,"«":112,"¬":113,"®":114,"¯":115,"°":116,"±":117,"²":118,"³":119,"´":120,"µ":121,"¶":122,"·":123,"¸":124,"¹":125,"º":126,"»":127,"¼":128,"½":129,"¾":130,"¿":131,"À":132,"Á":133,"Â":134,"Ã":135,"Ä":136,"Å":137,"Æ":138,"Ç":139,"È":140,"É":141,"Ê":142,"Ë":143,"Ì":144,"Í":145,"Î":146,"Ï":147,"Ð":148,"Ñ":149,"Ò":150,"Ó":151,"Ô":152,"Õ":153,"Ö":154,"×":155,"Ø":156,"Ù":157,"Ú":158,"Û":159,"Ü":160,"Ý":161,"Þ":162,"ß":163,"à":164,"á":165,"â":166,"ã":167,"ä":168,"å":169,"æ":170,"ç":171,"è":172,"é":173,"ê":174,"ë":175,"ì":176,"í":177,"î":178,"ï":179,"ð":180,"ñ":181,"ò":182,"ó":183,"ô":184,"õ":185,"ö":186,"÷":187,"ø":188,"ù":189,"ú":190,"û":191,"ü":192,"ý":193,"þ":194,"ÿ":195,"Ā":196,"ā":197,"Ă":198,"ă":199,"Ą":200,"ą":201,"Ć":202,"ć":203,"Ĉ":204,"ĉ":205,"Ċ":206,"ċ":207,"Č":208,"č":209,"Ď":210,"ď":211,"Đ":212,"đ":213,"Ē":214,"ē":215,"Ĕ":216,"ĕ":217,"Ė":218,"ė":219,"Ę":220,"ę":221,"Ě":222,"ě":223,"Ĝ":224,"ĝ":225,"Ğ":226,"ğ":227,"Ġ":228,"ġ":229,"Ģ":230,"ģ":231,"Ĥ":232,"ĥ":233,"Ħ":234,"ħ":235,"Ĩ":236,"ĩ":237,"Ī":238,"ī":239,"Ĭ":240,"ĭ":241,"Į":242,"į":243,"İ":244,"ı":245,"IJ":246,"ij":247,"Ĵ":248,"ĵ":249,"Ķ":250,"ķ":251,"ĸ":252,"Ĺ":253,"ĺ":254,"Ļ":255,"ļ":256,"Ľ":257,"ľ":258,"Ŀ":259,"ŀ":260,"Ł":261,"ł":262,"Ń":263,"<|":264,"|>":265,"re":266,"Ġt":267,"an":268,"er":269,"Ġc":270,"ou":271,"at":272,"ty":273,"st":274,"en":275,"ar":276,"al":277,"|><|":278,"Ġth":279,"Ġo":280,"reat":281,"es":282,"ure":283,"reature":284,"am":285,"lo":286,"man":287,"pe":288,"}{":289,"in":290,"po":291,"te":292,"ess":293,"ost":294,"gh":295,"mana":296,"|>{":297,"wer":298,"ame":299,"xt":300,"power":301,"you":302,"Ġyou":303,"ough":304,"Ġa":305,"ness":306,"name":307,"oughness":308,"yal":309,"yalty":310,"loyalty":311,"type":312,"Cost":313,"čĊ":314,"text":315,"toughness":316,"manaCost":317,"nt":318,"ge":319,"Ġthe":320,"Ġcreature":321,"it":322,"Ġb":323,"ac":324,"}<|":325,"\"<|":326,"ard":327,"Ġd":328,"ro":329,"âĢ":330,"Ġof":331,"le":332,"âĢĶ":333,"ĠâĢĶ":334,".<|":335,"ent":336,"is":337,"Ġp":338,"and":339,"get":340,"if":341,"Ġto":342,"ay":343,"or":344,"ur":345,"Ġco":346,"Creature":347,"Ġf":348,"Ġcard":349,"Ġ~":350,"ing":351,"Ġit":352,"Ġs":353,"Ġu":354,"arget":355,"Ġyour":356,"ld":357,"att":358,"Ġw":359,"Ġl":360,"on":361,"urn":362,"rol":363,"ĠS":364,"ant":365,"ch":366,"hen":367,"Ġcont":368,"Ġcontrol":369,"When":370,"Ġe":371,"ie":372,"ra":373,"Ġtarget":374,"end":375,"il":376,"ve":377,"Ġh":378,"Ġon":379,"Ġg":380,"Ġm":381,"Ġ{":382,"ers":383,"Ġthis":384,"ĠA":385,"Ġturn":386,"ic":387,"Ġan":388,"ast":389,"ield":390,"attle":391,"field":392,"attlefield":393,"Ġbattlefield":394,"Ġor":395,"Ġde":396,"Ġpl":397,".)":398,"Ġbe":399,"Ġ(":400,"Ġand":401,"ll":402,"Ġthat":403,"'s":404,"ut":405,"ach":406,"ith":407,"Ġin":408,"Ġunt":409,"age":410,"Ġ+":411,"ke":412,"/+":413,"ount":414,"ver":415,"Ġplay":416,"}:":417,"Ġwith":418,"ly":419,"|>\"":420,"En":421,"Ġend":422,"amage":423,"ment":424,"as":425,"ary":426,"Ġplayer":427,"ĠT":428,"Ġn":429,"ĠD":430,"Ġmay":431,"ir":432,"Ġdamage":433,"Ench":434,"pell":435,"Ġre":436,"Ġent":437,"Ġcount":438,"mb":439,"act":440,"tif":441,"rom":442,"Ġdeal":443,"Ġenters":444,"ĠH":445,"Ġspell":446,"Ġfrom":447,"ap":448,"ĠI":449,"tifact":450,"ain":451,"ever":452,"ĠC":453,"Whenever":454,"Ġuntil":455,"ĠE":456,"Ġget":457,"Ġcast":458,"},":459,"ack":460,"Ġeach":461,"ep":462,"ĠW":463,"Enchant":464,"'t":465,"Ġfor":466,"cer":467,"Ġput":468,"th":469,"Ġcards":470,"Ġcreatures":471,"orcer":472,"orcery":473,"lying":474,"Ġas":475,"Ġhand":476,"stant":477,"ice":478,"Ġits":479,"ib":480,"ĠP":481,"se":482,"Ġcan":483,"ĠR":484,"rif":485,"Ġgain":486,"ife":487,"Ġdeals":488,"In":489,"ion":490,"acrif":491,"You":492,"Ġgets":493,"ho":494,"Ġlife":495,"rave":496,"ĠHu":497,"loc":498,"yard":499},"merges":["< |","| >","r e","Ġ t","a n","e r","Ġ c","o u","a t","t y","s t","e n","a r","a l","|> <|","Ġt h","Ġ o","re at","e s","u re","reat ure","a m","l o","m an","p e","} {","i n","p o","t e","es s","o st","g h","man a","|> {","w er","am e","x t","po wer","y ou","Ġ you","ou gh","Ġ a","n ess","n ame","ough ness","y al","yal ty","lo yalty","ty pe","C ost","č Ċ","te xt","t oughness","mana Cost","n t","g e","Ġth e","Ġc reature","i t","Ġ b","a c","} <|","\" <|","ar d","Ġ d","r o","â Ģ","Ġo f","l e","âĢ Ķ","Ġ âĢĶ",". <|","en t","i s","Ġ p","an d","ge t","i f","Ġt o","a y","o r","u r","Ġc o","C reature","Ġ f","Ġc ard","Ġ ~","in g","Ġ it","Ġ s","Ġ u","ar get","Ġyou r","l d","at t","Ġ w","Ġ l","o n","ur n","ro l","Ġ S","an t","c h","h en","Ġco nt","Ġcont rol","W hen","Ġ e","i e","r a","Ġt arget","en d","i l","v e","Ġ h","Ġo n","Ġ g","Ġ m","Ġ {","er s","Ġth is","Ġ A","Ġt urn","i c","Ġ an","a st","ie ld","att le","f ield","attle field","Ġb attlefield","Ġo r","Ġd e","Ġp l",". )","Ġb e","Ġ (","Ġ and","l l","Ġth at","' s","u t","ac h","it h","Ġ in","Ġu nt","a ge","Ġ +","k e","/ +","ou nt","v er","Ġpl ay","} :","Ġw ith","l y","|> \"","E n","Ġ end","am age","m ent","a s","ar y","Ġplay er","Ġ T","Ġ n","Ġ D","Ġm ay","i r","Ġd amage","En ch","pe ll","Ġ re","Ġ ent","Ġc ount","m b","ac t","t if","ro m","Ġde al","Ġent ers","Ġ H","Ġs pell","Ġf rom","a p","Ġ I","tif act","a in","e ver","Ġ C","When ever","Ġunt il","Ġ E","Ġ get","Ġc ast","} ,","ac k","Ġe ach","e p","Ġ W","Ench ant","' t","Ġf or","c er","Ġp ut","t h","Ġcard s","Ġcreature s","or cer","orcer y","ly ing","Ġa s","Ġh and","st ant","ic e","Ġit s","i b","Ġ P","s e","Ġc an","Ġ R","r if","Ġg ain","if e","Ġdeal s","I n","i on","ac rif","Y ou","Ġget s","h o","Ġl ife","ra ve","ĠH u","lo c","y ard"]}} |