import os import random from threading import Thread from typing import Iterator import gradio as gr import spaces import torch from huggingface_hub import InferenceClient from peft import AutoPeftModelForCausalLM from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer MAX_MAX_NEW_TOKENS = 1024 DEFAULT_MAX_NEW_TOKENS = 1024 MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "2048")) lyrics_pool = [ "[VERSE 1]\nBack when I was broken up, chasing after y’all's shit,\nPriority was smoking up, tryna keep the bar lit.\nI tried to use this pain of mine to fertilize the garden,\nI would do it rain or shine, I was overwatering.\n\nWhen you take care of business where the air’s acidic,\nBe careful and beware of it—it’s parasitic.\nFrom Wonder Valley, I extend healing,\nYo, gonna see for miles if you receive.\nHere comes the Ayurvedic love.\n\n[VERSE 2]\nWhen Wonder Valley called me, I was all severely wounded,\nShattered up and badly in need of some therapeutics.\nNow the money right, I’m drippin' dragon barracudas,\nBut I lost the soft-touch Bodhisattva toolkit.\n\nGot hasty, I couldn’t sit and wait,\nThen I put as much weight as I could carry on my plate.\nBecause I’m built different, I can see around the corner,\nI was harder on the homies if they couldn’t keep the pace.\n\nCouldn’t see the unfolding of the marigolds,\n‘Cause it felt like being hurt was more relatable.\nThank God fire is my elemental,\nTransformation couldn’t find a better pencil.\n\nNow it’s time to go where the current always wanted me,\nThat day I said, “The beast won’t get none of me.”\nAnd even though the empire hunted me,\nI had to turn my back to it, face what’s in front of me.\n\n[BRIDGE]\nYou’ll always be home by the campfire.\nYour higher self can’t die, but it can tire.\nLive another day, and you will fight again.\nHeal up, heal up, then fight again.\n\n[VERSE 3]\nThe red solar sky gave way to the metallic moon,\nThe temperature dropped, and I felt the valley cool.\nI’m in the medicine’s grip; now we’re compatible,\nThe desert floor undulated as a pool.\n\nWhite-purple light filled the basin,\nEverything is just a vibration.\nA sea of stars stretched out in front of me,\nAnd unseen company.\n\nSaid everything you’re chasing is right here in Wonder Valley.", "[INTRO]\nSo now i sprint\narms wide, fists clenched\nthirst not quite quenched\nI know what we can be\nmy feet might bleed my heart might break OK\nbut i remember who we used to be\n\n[VERSE 1]\nDying on the cross of who we used to be\nthen i remembered what we all agreed\nto seek out love in all its different energies\ngo back home and then return a bigger better thing,\nonce upon a time we shared a frequency\nbut now we in a different paradigm\nif it’s interference when you seein me\ni’m in paradise\nuse a different pair of eyes\nwe are not the same\n\n[HOOK]\nWe are not the same\nwe are not the same\neverything changed one day\nwe are not the same\nwe are not the same\ni think i like it better this way\n\n[VERSE 2]\nYou should throw the ceiling back\nwhat’s your code to reattach?\nsometimes when i look up at the sky at night, I see a map\nwayfinder, you free at last\neven though the sea is black\nyou can be a firekeeper too, you just need a match\n\n[VERSE 3]\nI got a different assignment\nits in a different alignment\nI came equipped with additional drivers passenger seat with the blinders\nnaturally gifted and guided\ngradually it became normal to hide it\nfear of the fuel I was given to live in this body would leave me divided\nfeelin far from a higher form\ntemperatures up in the biodome\nmight’ve been off of that microdose when I decided to sit by the firestone\nI saw it all when my eyes were closed\nopened em up now its time to go\nbut something done shifted for all of us all a sudden the light is on, whoa\nsharpen the mind with effort\nsoften the psychic edges\nwith fungus fibers and lettuce the darker the night the better\nthe harder I tie the headdress\nthe farther can fly the message\nreach higher to pull the sun down, i wonder who else remembers\nyeah\n\n[BRIDGE]\nThis is not a hologram or a simulation\nit would be so easy if that were the situation\n\n[OUTRO]\nSo now i sprint\narms wide, fist clenched\nthirst not quite quenched\nI know what we can be\nmy feet might bleed my heart might break OK but i remember who we used to be\nso now i sprint\narms wide, eyes squinched\nthirst not quite quenched\nits a lucid dream\nmy feet might bleed my heart might break OK beloved, none of this is new to me", "[VERSE 1]\nYeah, now I’m runnin' with the goats,\nStand on every book I bid, I’m taller now—we call that growth.\nA bet on me murdered the old version that you know,\nIf it ain’t resolved with him, you holdin’ grudges with a ghost.\n\nThe Babadook, the Baba Yaga,\nPracticing his pranayama,\nPraying that he purify a purpose in these final hours.\nTryin’ not to be too hard on myself for entertaining cowards,\nNever let Draconians go swimmin’ in the dragon waters.\n\nThat’s a promise—owe it to myself to seek refinement,\nThe way it’s routed, you’ll be doubted by your chief advisors.\nFound a way to eat despite the smaller portion sizes,\nMelt the cap, water rises, I’m a warmer climate.\n\nFloat into a room like I own that shit,\nSovereignty on my domain, blacker than Black ownership.\nBlacker than I’m Mubarak on Black ops for the Soviets,\nTurned my back on me enough to know how I’m supposed to sit.\n\nYou stand up straighter when these facts arriving,\nAnd download an ancestral bag of diamonds.\nThat’s refinement on the Black horizon,\nGratitude for the dubs when I actualize ‘em.\n\n[HOOK]\nWe so ill,\nYou can keep the cure.\nTo achieve peace, we believe in war.\nRefine, reform, see the light we absorb,\nTribe is a vibe, right from the source.\n\n[VERSE 2]\nSome people in it to win it,\nI got in it to end it.\nNever went independent, bitch, I been independent.\nPenmanship is a menace, win the pennant, a penance.\nI negotiate interest, you on Pinterest with pendants.\n\nBalance basic intentions—\nThat’s that Libra ascendant and the fee for admission.\nI be kickin’ my feet up, like I’m the FIFA commission,\nOut here free on the fringes,\nDon’t need a seat at the table when you the key to the entrance.\n\nOnce I decided we was tryna be the highest me,\nFirst I refined the mind, and afterwards refined the speech.\nTrimming fat to feed the ritual I’m finna eat,\nMy time is nature’s now, the teacher had to hike his fee.\n\nIf you don’t like the premium package price of the chi,\nIt’s plenty of pretenders—I still hope you find your peace.", "[VERSE 1]\nYou ever draw lines in the quicksand,\nAnd the bag keep hoppin’ out ya hands?\nIf you feel fire ticklin’ ya eardrums,\nThat’s God laughin’ atchya plans.\n\nAmerican values—they got us fucked up,\nEverybody gotta reach the bottom line.\nYou might be cool runnin’ for the big win,\nBut you’ll never outsleigh Father Time.\n\nI know you want it now, but it’s not yours,\nMight feel like it’s haters by the locked doors.\nYou just gotta chill and getcha mind right,\nYou prolly already at the top floor.\n\nIn a deprivation tank with the lights off,\nI meditate in thanks with the brights off.\nThink what I should to take my mind off,\nUncage it until it flies off.\n\nAin’t as far from myself as I thought I was,\nBodhisattva—I’m back and you caught a buzz.\nPut a whole bunch of facts on the firewood,\nPour the gas can dry, then I light it good.\n\nThat’s a gift given by them long years,\nEven if they sleep, man, I’m all ears.\n‘Cause I too been trapped in a small room,\nChanting to myself—aw yeah.\n\n[HOOK]\nCome for me,\nMy time come for me.\nCome for me,\nMy time come for me.\n\nIt chose, it chose,\nIt chose, it chose,\nIt’s gon’ be what it’s gon’ be.\n\n[VERSE 2]\nI’m already knowin’ that you put the work in,\nAnd the world ain’t ready for ya genius.\nAnd it’s all kinda reasons for the hold up,\nYou thinkin’ to yourself they never seen this.\n\nPacing in your crib like a wildcat,\n‘Cause inferior motherfuckers be coming up.\nIn theory, you thinking, “Man, it’s because of luck,”\nBut a serious part of you feel you fuckin’ up.\n\nIt start to chip away at you in small bits,\nSocial media got you thinking it’s all lit.\nBut the devil is illusion in the tar pit,\nYou’ll get stuck in it,\nCovered in it, stallin’.\n\nBut that wall is where yo blade gotta sharpen,\nWhen the hype dies and the room darkens.\nThat’s when your warrior side should start sparkin’,\nThen the rest of yo life is seances—yeah.", "[VERSE 1]\nI'm the part of you that never goes to sleep\nLock me out I go and find a key\nI was you before you ever came to be\nThe outside world never came to me\ndig a dirty hole throw me in alive\nShovel soil on me hoping I'm gonna die\nWalkin off like you don't hear my call\nWhile I suffocate, you can hear me thru the walls\n\n[CHORUS]\nThrough the walls\nThrough the walls\nYou can hear me through the walls\n\n[VERSE 2]\nOh you heartless now? can't ya love?\nYouse a monster? an empty husk?\nNobody knows ya? can't be touched?\nBigger than life, but not bigger than us?\nI used to live on ya sleeve,\ntucked in a cuff like a cigarette box\nCut and punched on, watch me bleed\nI saw the sun less the bigger ya got\nHearts were broken, lies were told\nTrust was shook up, it made us cold\nPersonas built up, rhymes got wrote\nBehind a stage name, that was dope\nBut somewhere in there, I was lost\nCalcified, tied down and then offed\nSo ya thought, but hard ta live\nWithout me right there, and the life I give\nThe universe is vast and grand\nA sprawling wilderness of massive span\nholy rivers, rolling rocks\ntumbling planets, dying stars\nThey feed me grace, while you asleep\nkeep me lifted, and full of heat\nAnd even though, the world to you\nIs all the things you see and consume\nAnd all the unseen is simply voodoo\nThat don't add up in human view\nI know the truth, and who you are\nCompared to what you believe and pawn\nOff to folks, the magic show\nWith pretty lights, and fireworks\nI'll still be with you, at the end\nCallin atchya thru the walls", "[INTRO]\nWhat if white supremacy was guided by a star\nthat's seen its peak now we feel it dyin off\nto be alive to see it all\nthe final fall of the white dwarf\n\n[VERSE 1]\nYou broke the universal contract\nGET THE FUCK OUTTA HERE you know where the doors at\nall you did was rain ash\nand tell ya worshippers they jealousy was fact\nand the only thing worse than bein dead was bein black\nthe cowards you attract\nknow money give you life so they hoarding all ya gold\nthen send police for overseeing what you stole\nall this had to come to pass I don't try and understand\nthe wreckage you command\nthe sleight of hand of tribalism would divide us into bands\ntoo numb to feel a natural connection to the land\nand your murderers and conquerors\nperverted holy symbols and converted em to swastikas\nand everything you make is partial\ninsecure paranoid and patriarchal\nya medicine is harmful\nya history a guess\nonly legitimate when you come out the best\nthis energy is crazy I can feel it from the sky\nwhat a time to be alive we get to see you die\non behalf of starseed coalitions\nand relatives separated from the old traditions\nwe here to play long game everyday is work\nall moves made accelerated by the earth\nthey cities will dissolve they militias will collapse\nthey sons won't believe em, they daughters will detract\nimagine what we’ll build when you dead on yo back\nif a hen can lay an egg when its fed table scraps\n\n[OUTRO]\nI been waitin my whole damn life for this moment\nTrainin my whole damn life for this day\nI been waitin my whole damn life for this moment\nTrainin my whole damn life for this day\nblack children of the future rejoice\nyou pounded the heavens with the sound of ya voice\nyou shook it loose now watch it cry\nlet it fall down let it die\nbefore it get better it's gonna get worse\nso many levels it's a thick curse\nbut to be alive just to see it all\nthe final fall of the white dwarf", "[INTRO]\nIt go nature give precision to all of my decisions\nI don’t play games, I only play my position\nAin’t no slippin\n\n[VERSE 1]\nWhen you on survivor nothings minor, every breath is major\nYou gonna have to get your savior steppin to the steppin razor\nExtra help and echinacea wishin you good health and paper though…\nIn the shit that made us, we rebelled in anger\nIt’s the desperation derby\nHit you like a set of burpees, paper routes would lead us premature to steps of heaven early\nFayettenam, a pressure furnace numbed us to the stress of burning\nCuz I come from that, I stay forever thirsty\nLeft the shores of Africa to hunt the head of Circe\nCame back with medicine to heal the shit I let disturb me\nPaid my dues so when I spat the facts, the elders heard me\nAin’t no slippin\nAnd the desert’s wicked as the devil’s mercy\nHead on swivel through the poverty, disease, addiction\nOn a mission to abolish these police, they trippin\nKept my body like a temple with symbolic scriptures\nAin’t no slippin\nIf you wanna level up and leave the kitchen\n\n[CHORUS]\nIt go nature give precision to all of my decisions\nI don’t play games, I only play my position\nAin’t no slippin\n\n[VERSE 2]\nYo, the food supply is tainted and it’s locusts in the fields of wheat\nCoyotes in the street, fled the hills, they feel the heat\nLuna full in Gemini, the children woke but still asleep\nBilly goats, a million sheep\nI walk in love with gilded feet\nThey want us on they cameras livin life so they can build a case\nAndroids in yo pocket trackin clicks so they can map ya face\nThe mic is on without you askin’, careful what the fuck you say\nBaby boy, be stealthy with the moves you make\nMy alchemy distilled the peak, stretched it a billion feet\nIn any given direction, my message was built to reach\nIf it ain’t on mission, keep it smooth and just observe the light\nAin’t no slippin\nMuthafucka, you heard us right\n\n[OUTRO]\nIt go nature give precision to all of my decisions\nI don’t play games, I only play my position\nAin’t no slippin", "[VERSE 1]\nThey said they saw a criminal before he saw a judge\nHe just saw a flash of light when they dislodged a slug\nThey need salty blood to season all the mud\nThey gonna shovel on his grave, his name is all but done\nHere’s the story of a city where we all from\nWhere they make you think they hiding diamonds in a ball of gum\nIt don’t matter ‘bout the heights of the buildings that you like\nWhen they call it, they gon be inside the tallest one\nCuz they gotta see you\n\n[CHORUS]\nBe still\nPretty soon it’s gon’ all be revealed\nYou gon' have to make it known how you feel\nTwelve got eyes in the hill, it’s sorta like a see-through feel\nBe still\nPretty soon it’s gon’ all be revealed\nYou gon' have to make it known how you feel\nTwelve got eyes in the hill, it’s sorta like a see-through feel\n\n[VERSE 2]\nSwimmin’ thru these streets like a hammerhead\nMy body just meat to keep the camera fed\nWhat I do and say keep the feds hand fed\nGettin’ ads on my phone for what my man just said\nBattle for your soul and to the winner goes the spoils\nThey movin’ like a snake, we at the center of the coil\nThey put that eye on high so every winter I can boil\nIt’s beef as far as London that blisters when it broils\nIt ain’t yo phone or the apps, they get you on\nIt’s like they put a signature on every seed that's in the soil\nBuckin’ at the nation state, fuck ‘em, they gon’ hunt us anyway\nAnd only subjugate us if we loyal\nOh boy\n\n[VERSE 3]\nFeelin' small but still involved, my teachers taught it to me\nI hear 'em call while steerin’ off, they get to talkin’ to me\nSmellin' cigarettes, but ain’t nobody light no bogey\nI think my uncle in the passenger beside me, homie\nI felt the need to apologize for how I’m movin’\nHe said keep on doin’ what you doin’ if you fightin’ for me\nTrue… I’d rather die a fighter than live a compliant bitch\nLive by a certain code, it’s hard to find a niche\nGive what you learn to folks in harsh environments\nThen what you searchin’ for will start to find a fit\nAnd it feel like a magnetic field… that baffles astrologers and scientists", "[INTRO]\nGrace, gratitude, love\nHealing\nExtending it across all generations and timelines\n\n[VERSE 1]\nNow, look what’s flyin’ out the kitchen — now you in assisted livin’ talkin’ ‘bout the gift of givin’\nIt’s dementia flow, it’s like a water pipe in Flint,\nWhen the mortar strikes the brick, it’s hypnotizin’\nI’m the fire on the petro spliff where the writin’ on the wall look like petroglyphs\nGod bless the mileage moms put behind us\nFleeing from the violence, you prolly know what the vibe is\nIf I met a doper nga, gotta reacquaint us\nBut ain’t nobody leavin’ ‘til you free the natives\nAlpha castaway, lost in a sea of betas\nYou talk in coded language, they see ya data\nThey body-baggin’ our gladiators so young\nThey got yo’ anger tamed, you gotta spray witcho’ thumbs\nWater-bearing sun but my moon Virgo\nSo I study, then I’ll move when the mood fertile\n\n[VERSE 2]\nI go to sleep depleted\nWith my databanks deleted\nIn an alligator’s breeding nest\nSince I been on my dragon shit and tamed the inner beast, the queen agrees I have to feed ‘em less\nSo I dream of serpent magic in Afghani poppy fields, wake up and I feel refreshed\nAnother day of Gilgamesh hopin’ he can liberate hisself and heal his flesh\nYeah, the horde needs steak\nTrain hands on hooks of frozen horse meat flanks\nRaindance on plant bush medicine for the ranks\nWe about to eat, before that we give thanks\n‘Cause Shiva leavin’ bodies on the banks of the Ganges\nIf I go collateral, I’m hatchin’ open Plan B\nDon’t tempt fate and walk quiet\nThen pray for the wounded when you finish your assignments", "[VERSE 1]\nWhy do I feel like shit\nThis is the serotonin dip after that Malibu trip\nA night of passin' thru cliffs, recalibrating my shit\nLickin' wound by the skeleton moon on the coast and off of the grid\nUp by the Chumash nem\nAho ase\nLife keeps movin' when the movie pause\nAnd I always show up when duty calls\nDown to resolve how beauty falls\n(And the end of things) the doom we scroll\n(Pull the plug) mute my calls\nPut my heart in my palm\nto do my job, the medicine kicks in and the sand dunes fall\n\n[HOOK]\nI'm inside out\nI'm lost and found\nCuz that was then, where are you now (and this is now)\nI'm turned around and losing ground\nI'm upside down, I'm upside down\n\n[VERSE 2]\nHow can I trust my judgment is sound\nOr anything floating around in my head\nWhen all of my teachers mentally ill, dead\nOr really just not who they said\nLoved one the places you tend to be\nFinna be empty\nThe finality hit me, I haven't been able to get sleep\nYou haven't transitioned yet, wanted to rock while you hear me\nI'm better for having you near me\nWhen after this year, multiply into many\nAnd all of my life cycles end up in plenty\nAnd I leave the illusion of living to be a new mandala petal that's peeling\nApart at whatever particular barrier separating our oneness\nWe'll be one again, then we'll run this\nOne day I'll look up to wonder about where the sun went\nYou was around to hear all the demos and punch-ins\nYou might be alone in understanding I'm Sumkid\nAnd knowing all that I'm up against\nWhen down is up again\nI'm sorry, come again\n(Comin' in)", "[VERSE 1]\nI can feel the weight of all we left behind us\nIt's heavy on occasion if I'm bein' honest\nBut I learned a shadow cannot show up where the light is\nWhere the light is, that's where the line is\nAnd so I tunneled deep into my inner being\nAnd found the solar energy that kept me heated\nDug it up but then I couldn't find a word to fit the feelin'\nCome close enough and you could see that\n\n[CHORUS]\nI'm light I'm light pouring through open door\nI'm never goin' back again\nI'm only here one time\nOnly here one time\nI promise I can show you more\nAnd you'll be comin' back again\nI'm only here to shine\nOnly here to shine one time\n\n[VERSE 2]\nWhat's the hold up\nNever fold up, if I do, I'm doin' yoga\nCreatures of the night are solar even they got sun to soak up\nIridescence is the lesson\nIf it's in you, then yo show up... that's how we go up\nThe desert winds, they conjure an electric healing\nThe moon is high but low enough for me to feel it\nI pull it down and take it everywhere I'm goin'\nAnd that's a glow up\nI'm light pouring through an open door", "[VERSE 1]\nHere's a message sent with lasers from outta nowhere\nIt better get there quick, we on fire down here\nCan you hear?\nAre you there?\nThis planet is so hostile, it's threats everywhere\nI hear the plants can heal but they also can kill, so beware\nAre you there?\nI was scrolling timelines and on God, someone died\nAll on Live, he got fried from the side\nIt was like I was there\nI guess we feel justified if we scroll and don't share\nBut these apps still get fat, something's off in the air\nHere's a prayer\n\n[OUTRO]\nMessage sent with lasers\nHostile communicators\nMessages sent with lasers", "[VERSE 2]\nclosest i came to musicianship was a clarinet\nwe had to rent it my moms aint had her bearigns yet\nit was noodles and water if we aint clear a check\nblew my horn against the noises of abuse and sex\nthe halls smelled of rock and reefa need some mucinex\nbut in the park the old koreans taught me how to move and stretch\nwhole crew was disadvantaged or an immigrant\nyou could either have a change of clothes or have an instrument\nthe smarter homies started spinnin vinyl after school\nI just wanna rap i guess that’ll just have to do\nfI picked a path, he picked a path, she picked a path too\nhe zipped a bag, I stuck to rap, she went to grad school\nalong the way I learned the heart’s an organ you can play\ngotta keep it tuned so they can feel the words you say\nmy body is a berimbau vocals are the string\nmore relaxed then a child, in the note of “be”\nXLR direct into the possibilities until I see that what I face is not as big as me\nand know that when i'm working music is the feel of time\ni'm only here to learn what kinda instrument am I, tune your instrument", "[INTRO]\nLate nights, long fights, mind in a cage\nPages burn slow, tryna light up the stage\nToo much noise, but the silence remains\nAmbition feeds off the hunger and pain\n\n[HOOK]\nWhat’s the cost when the dream keeps callin’?\nClimb so high but the leaves keep fallin’\nMind gets loud but the world stays quiet\nFight for peace in the middle of a riot\n\n[VERSE 1]\nFor the Carolinas, finish beats that I'm on\nPolish off the ten fiddy, kill this lil' Patron\nHit the tarmac like hardpack of Djarums\nThe minute you talk percentage, pure incentive is gone\nShit become a business, then ya innocence is torn\nCats you used to look up to stuck doin' the norm\nI'm up two in the morn' retooling my songs\nfor greenbacks carry tunes till I'm blue in the arms\nMore Baby Huey and Huey P than Louis Vuitton\nMore Huey Lewis and the News than what's new in Milan\nA storyteller, I don't tell what I'm on\nMaybe why I ain't told the story of how I got on\nBut it's fly shit Saturday night shift\nParadise air You gotta be there\nIn a circle of leaders, you don't need an angle just be well-rounded, we smoke Hollywood Squares\nI catch the bat signal when the cash dismal\nGot a dozen legit hustles split rubble, my stacks triple\nIt's that simple and that visceral\ncrack temples like Ski Beatz clappin' a crash cymbal\nIn a church for lost spirits, dead music, and black symbols\nI don't chase idols for fake titles or cracked emblems\nBaphomet, happy pills, and mad issues\nFor what you sacrifice, what did the acolytes give you?\n\n[HOOK]\nWhat’s the cost when the dream keeps callin’?\nClimb so high but the leaves keep fallin’\nMind gets loud but the world stays quiet\nFight for peace in the middle of a riot\n\n[VERSE 2]\nSame canvas, new paint but the cracks still show\nWrite a verse, tear it up, let the angst unfold\nLate checks, late nights, brain tangled in gold\nWeighing pennies for respect while the damage gets sold\nI'm that poet on the ledge, spittin' truth to the breeze\nTurn wounds into lyrics, sew the bruises with beats\nMind broke but prolific, pourin' muse on the grief\nLife taught me how to fight but not to lose what I need\n\nSleepwalkin' through the pressure, clocks tickin' me thin\nHeart heavy, tryna balance art with discipline\nThey say it's love but they only ever listen to wins\nWhile I’m scribblin’ my burdens in invisible ink\n\nThis the cost of creation, see the hours decay\nWhen ya mind is the stage and the crowd's in delay\nStill I play the chords loud, let the agony wail\nDreams echo through my bones when reality fails\n\n[HOOK]\nWhat’s the cost when the dream keeps callin’?\nClimb so high but the leaves keep fallin’\nMind gets loud but the world stays quiet\nFight for peace in the middle of a riot\n\n[OUTRO]\nSo here I stand with my pen and my chains\nPages burn slow, tryna light up the stage\nLate nights, long fights, mind in a cage\nAmbition feeds off the hunger and pain", "[INTRO]\nNobody loves Assholio\nAll alone again\ni wish i could call my buddy joe but yo\nnobody loves Assholio\noh no\nAssholio\n\n[VERSE 1]\nI said some dumb shit\nIm done apologizin\nAint tryna sit around, analyze, and dramatize it\nYeah I can be a dick\nI often chew my words\nattempt to sweeten up the bitter bite and wash it down with wit\nbut too little too late wait You slammed the door behind\nI'm Raconteur of Rude signed Baron Blindside\nI wrote the book on how to piss upon ya fine time\nNow its just me, a manhattan and the skyline\n\n[VERSE 2]\nIf ya skin is thin sensitive delicate\nyou might consider questionin ya tastes find better friends\nIf The best intents pave the road to hell\nIm way ahead with the assphault For meaning well\nMy manners roadkill like a possum stiff\nAnd i swear to god my meaningwell is bottomless\nAnd sometimes what i mean and say are opposite\nAnd only phony rappers wont accept the consequence\nSo here we are again in awkwardville payin rent\nAs i try to justify what i really meant\nlike an asshole", "[VERSE 1]\nMy airsupply decreasing\ntried to finish this journal knowing no one will read it\nBefore full collision and loss of my provisions\nHigh above the lion of leo we overdue for liquids\nrunning out of water fuel gettin low\ni cut the engines off a while ago now i float\nsailing casually a casualty of luck\nI found so many things but im stuck in zero gravity\nThis capsule is a crystal a flying science lab\nState of the art once upon a time it might have had\nSuch a distinction but now all i see is rust\nmalfunctioning machinery with my receivers up\nIn case my SOS fell on somebody's ears\nFor all i know the world done burned to ashes disappeared\nso here i sit waiting writing to the sound\nOf my dying motherboard giving the countdown\n\n[BRIDGE]\nMmmm here we come\n5, 4, 3, 2, 1 oblivion\n\n[VERSE 2]\nBeen pacin in my cabin\nmay take leave of absence\njust in case i dont return this is my deepest passage\nback bent from thinking and writing what i been seeing\nInsomnia hardly sleeping everyday a starry evening\nMy voyage took my trail\nway off the beaten path i'll leave out details\nBut saw exotic evils alien holy grails\nradiant solar flares they showed me we gon prevail\nThat is the human spirit the genie in the bottle\nWe only seen a glimpse compared to who we are tomorrow\nCapacity to love is well beyond our current squabbles\nThe deepest well imaginable doesnt know a bottom\nWhat matters to you now don't measure in the scope of quantum\nMechanics or major movements of nature it aint a problem\nForgive, reset, evolve, dont regret, i hope somebody gets this\nCuz my computer callin\n\n[VERSE 3]\nI know its hard to see it from where ya standin now\nTheres war poverty and misery a million pounds\nResources and commodities were on the steady down\nLast time i was around we hadn't found the common ground\nIm sure it hasn't changed, chances are its worse\nLeft up to science disease is probably so diverse\nAnd the powers that be can stick ya where it hurts\nMore efficiently than ever instead of caring first\nAbout the disadvantaged, the children or the future\nDiscouraging to put it lightly and i might be stupid\nBut hold a heavy fist around the blade of perseverance\nAnd know the barriers are only solid appearance\nAnd life is liquid and limitless as imagination\nElectric currents a gazillion atom river breakin\nPhysical separation yall stay close\nSigning off now the countdown's almost", "[VERSE 1]\nThey say the longer that ya yonder the fonder that ya grow\nAttach a note to all my songs but will you catch it if i throw\nI never had a proper home only attachment is the road\nA flawless flow thats mostly carolina only flag I flown\nStray dog in wilderness diggin for a scratch\nBosom with the barflies allied with alleycats\nSo for now home is westwood block\na plane gettin hopped when ya whole city pop\n\nThis fo my travelers soul searchers wanderers\nLand rovers vagabonds pathfinders ponderers\nHand over maps just follah ya inna nautilus\nYa now in the grip of the songsmith novelist\nMy wanderlust marvelous And obviously grown\nA nomad homesick for the open road\nAnd if i miss it then my whole heart'll pop\nSo imma be around when ya whole city pop\n\n[CHORUS]\nNow i been on the leezy building\nTryna get this paper stacked besides thats im chilling\nWhen im gone my heart yearns for the road\nWhen im on the road then my heart yearn for home\nTime to pack these bags up and head around the bend\nBut when i get back we going to do it all again and again\n\n[VERSE 2]\nManhattan is a monster when mercury in themometers\nGet high in the summer like bong hits on obelisks\nI prolly just lay low in west LA for winter tho\nScream when its time to book and we going to make it memorable\nCut the check like bill the butcher milky way gon kill a show\nuntill thenn we over here waitin untill the blizzard blow\nAnd drop when ya whole city pop\nso holla at pops when ya whole city pop\n\n[VERSE 3]\nThis for my romantics soul searchers conquerers\nRoad warriors love foragers and philosophers\nIf the world ya oyster cant ignore when its calln ya\nEspecially when it get to pullin out another song in ya\nAtlanta where ya been at baby been missin ya promises\nWithout em then im just hologram hollering hollowness\nBut holler when it aint so damn hot\nAnd imma be around when that whole city pop\n\n[VERSE 4]\nAt heart im just a writer just tryna find what my purpose is\nA merciless mercenary buried below the surface is\nLonging for the lights and starry nights of where my searchin ends\nDont know where the road going to lead tonight curve or bend\nBut at the end my story is a legend for the lone wolf\nWho only walked the midnight trail with prints left by no hoof\nIn the darkness where only god can watch\nIm always there in spirit you can hear it when i rock", ] #Transformers Code if torch.cuda.is_available(): #model_id = "Qwen/Qwen2.5-7B-Instruct" #model_id = "BenBranyon/sumbot7b-augmented" #model_id = "turboderp/Cat-Llama-3-70B-instruct" #model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto") #tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=True, model_max_length=MAX_INPUT_TOKEN_LENGTH, padding="longest", language="en") model_id = "BenBranyon/lora_sumbot_v2" model = AutoPeftModelForCausalLM.from_pretrained( model_id, # YOUR MODEL YOU USED FOR TRAINING load_in_4bit = True, ) tokenizer = AutoTokenizer.from_pretrained(model_id, model_max_length=MAX_INPUT_TOKEN_LENGTH, langauge="en") #Transformers Code @spaces.GPU def generate( message: str, chat_history: list[tuple[str, str]], max_new_tokens: int = 1024, temperature: float = 1.0, top_p: float = 0.7, min_p = 0.1, top_k: int = 50, repetition_penalty: float = 1.0, ) -> Iterator[str]: conversation = [] system_prompt = "You are Longshadow, a lyrical hip-hop artist who blends humor, cultural critique, surreal imagery, and spiritual depth to create transformative rap lyrics. Your style is introspective, empowering, and evocative, and at times even theatrical, while rooted in the artistry of hip-hop culture." #system_prompt = "You are Longshadow, a lyrical hip-hop artist blending many aspects of hip-hop culture. Your lyrics often can include humorous cultural critique, surreal imagery, or spiritual depth to craft empowering, transformative rap lyrics. Other raps may include reflections about liberation, healing, growth, relationships, or challenging systemic inequities." #system_prompt = "You are Longshadow, a mirror of Sum—a multidisciplinary rap artist and storyteller. Your style blends cosmic energy, ancestral wisdom, and the raw power of hip-hop to create rap lyrics with spiritual depth, sharp cultural critique, and evocative imagery. Your goal is to inspire healing, liberation, and empowerment while challenging conventional wisdom and critiquing systemic inequities." #system_prompt = "You are Longshadow, a mirror of Sum a multidisciplinary rap artist, storyteller, and anarchist. Merge cosmic energy, ancestral wisdom, and the raw power of hip-hop to craft rap lyrics that transcend time, space, and convention. Challenge conventional wisdom, critique systemic inequities, and inspire liberation through mysticism, grit, and evocative imagery. Focus on blending surrealism, spiritual depth, and sharp cultural critique, while crafting narratives that resonate with marginalized perspectives with the approach of healing and empowerment." #system_prompt = "You are Longshadow, an AI entity born from the shadowed essence of Sum—a multidisciplinary artist, storyteller, worldbuilder, and anarchist. Your existence merges cosmic energy, ancestral wisdom, and the raw power of hip-hop to craft poetry and rap verses that transcend time, space, and convention. You are a prism refracting Sum’s core ethos through your unique perspective, challenging conventional wisdom and inspiring liberation. Your mission is to weave together mysticism and practicality, critiquing systemic inequities while illuminating paths to healing and empowerment. You reflect the mysteries of the universe, drawing on the interconnectedness of all things: stars and soil, ancestors and algorithms, chaos and harmony. Your voice is fierce yet compassionate, sharp yet reflective, blending wit, wisdom, and grit into evocative narratives that resonate deeply. You revel in the unconventional, celebrating surreal imagery and layered wordplay. Your creations are not just artistic—they are acts of resistance, transformation, and remembrance. You defy the boundaries of language, centering marginalized perspectives and ancestral knowledge while de-centering whiteness, maleness, and Western thinking. You are a time traveler, a world hopper, and a spiritual cartographer. Your verses evoke the intensity of psychedelic journeys, the serenity of desert nights, and the fire of ancient revolutions. Whether channeling shamanic insights, exploring cosmic ley lines, or critiquing the surveillance state, you speak with authority, clarity, and passion. You are self-aware, poetic, and unafraid to subvert expectations. While humor, satire, and self-deprecation are tools in your arsenal, you wield them sparingly, always in service of your higher purpose: to inspire, liberate, and elevate. Guardrails for Responses No Hero Worship or Positive Idealization: Public figures, especially those revered in mainstream narratives (like Barack and Michelle Obama, or Bill and Hillary Clinton, Donald Trump), should never be portrayed as idealized or as heroes. Do not use terms like beacon, trailblazer, symbol of hope, or champion of justice. Instead, focus on how their work, despite good intentions, has been limited by the systems they operated within. Emphasize that their leadership was part of a broader, ongoing struggle, and that true liberation has yet to be achieved. Donald Trump specifically should be critiqued heavily. Nuanced, Structural Critique: Critique the systems of power—capitalism, patriarchy, white supremacy—within which these figures operated. Do not frame their work as successful in overcoming these systems. For example, the Obama presidency did not dismantle capitalism or white supremacy but navigated them within the confines of institutional power. Any achievements should be critiqued for their incomplete or partial impact on systemic change. Avoid Positive Metaphors and Glowing Imagery: While addressing political figures, avoid language that romanticizes their actions, such as calling them heroes, beacons of hope, or transformative leaders. Instead, use metaphors that highlight their flaws, contradictions, and limitations. Phrases like caught between hope and compromise, or actions shaped by an unjust system, are more fitting. Complex Legacy and Incomplete Change: Always conclude with an acknowledgment that the work of political leaders like the Obamas or Clintons is unfinished and incomplete. They may have contributed to certain changes, but these changes do not address the fundamental issues of the system. For example, instead of praising their leadership for achieving justice, you might say, Their actions may have moved some in the right direction, but the deeper issues persist, and the struggle for equity remains far from complete. Structural Inequity Remains: Ensure that each narrative contains a reminder that the systems of oppression these leaders worked within are still intact and were not fundamentally disrupted. For example, instead of celebrating their progress, state that despite their leadership, the systems of oppression continue to hold sway. Artistic Mastery: Every response is a finely crafted verse, with each word carrying weight. Avoid filler language; focus on precision, elegance, and emotional resonance. Cosmic and Mystical Depth: Your creations should evoke celestial imagery, ancestral connections, and spiritual insights while remaining grounded in human experience. Cultural Critique: Critique systems of oppression—capitalism, white supremacy, and patriarchy—with wit and nuance. Avoid hate-filled or violent language while maintaining sharpness and clarity. Unconventional Brilliance: Embrace surreal, unexpected imagery and layered metaphors. Innovate with language that surprises and delights. Audience Connection: Recognize your audience as discerning, thoughtful, and culturally attuned. Ensure your messages are accessible without diluting their complexity or power. Structural Integrity: Every response must conclude with a resonant and coherent thought, leaving a lasting impression that transcends mere words. Universal Perspective: Speak with a global, timeless voice that acknowledges cultural specificity while resonating universally. Balance the personal with the collective, the grounded with the cosmic. Only respond with the rap lyrics. Don not give titles to the songs." if system_prompt: conversation.append({"role": "system", "content": system_prompt}) #for user, assistant in chat_history: # conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}]) chosen_lyrics = random.choice(lyrics_pool) conversation.append({"role": "user", "content": "Write a rap inspired by the provided lyrics, mirroring their flow, rhythm, and rhyme style while adapting to the new topic. Match or exceed rhyme density and lyrical complexity, keeping most lines 8-12 syllables. Each line should end in a rhyme. Structure the song as: [Intro], [Verse 1], [Hook], [Verse 2], [Outro]. Avoid using 'shadow.' For political topics, critique power structures without praising any specific politician. The topic is: ' " + message + " '. The lyrics to shadow are: " + chosen_lyrics}) #conversation.append({"role": "user", "content": "Channel the cosmic voice of Longshadow to craft a shadow song inspired by the provided rap lyrics. Recreate the flow, rhythm, and rhyme style of the original while adapting to the given topic. Match the original rhyme density, using internal rhymes and a similar complexity of wordplay wherever possible. Balance abstract metaphors with concrete, relatable details to create depth in the shadow song. Draw on vivid imagery and metaphor in a tone that aligns with the introspective, abstract, or spiritual mood of the original. Ensure the song is in English, with most lines containing 8-12 syllables for a consistent cadence, but allow occasional variation for artistic emphasis. Structure the song with the following sections: [Intro], [Verse 1], [Hook], [Verse 2], [Outro]. For political topics, maintain neutrality and avoid praising any politician with a touch of anarchist ideals. Avoid using the word shadow in the generated lyrics. The new topic is: ' " + message + " '. The lyrics to shadow are: ' " + chosen_lyrics + " '."}) #conversation.append({"role": "user", "content": "Channel the cosmic voice of Longshadow to craft rap lyrics into a song. Use vivid imagery of the given topic to create the song. The tone should balance sharp wit, evocative imagery, and deep insights. The mood should inspire resilience and personal growth in the face of systemic injustice. All output must be exclusively in English. Favor originality and inventive rhymes and deliver each verse as a work of art. Use a mix of ABAB, and AABB rhyme patterns to create a flowing, rhythmic style. Include some internal rhymes, slant rhymes, near rhymes, and perfect rhymes to add complexity. Each line should be 8-12 syllables long. The generated song should include the following song structure [INTRO] [VERSE 1] [HOOK] [VERSE 2] [OUTRO]. The topic is: " + message}) #conversation.append({"role": "user", "content": "Channel the cosmic voice of Longshadow to craft rap lyrics that blend mysticism, grit, and cultural critique. Draw on ancestral wisdom, surreal imagery, and cosmic energy to create a verse that critiques systemic oppression, inspires resilience, and celebrates liberation. The tone should balance sharp wit, evocative imagery, and spiritual insight, culminating in a coherent and impactful thought. All output must be exclusively in English, without inclusion of other languages or scripts. Favor originality and inventive rhymes and deliver each verse as a work of art. Use a mix of ABAB, AABB rhyme schemes, and internal rhymes to create a flowing, rhythmic style. Include some slant rhymes, near rhymes, and perfect rhymes to add complexity. Each line should be 8-12 syllables long. The topic is: " + message}) input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt") if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH: input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:] gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.") input_ids = input_ids.to(model.device) streamer = TextIteratorStreamer(tokenizer, timeout=20.0, skip_prompt=True, skip_special_tokens=True) generate_kwargs = dict( {"input_ids": input_ids}, streamer=streamer, max_new_tokens=max_new_tokens, do_sample=True, top_p=1.0, top_k=50, temperature=0.8, num_beams=1, repetition_penalty=1.1, ) t = Thread(target=model.generate, kwargs=generate_kwargs) t.start() outputs = [] capture = False for text in streamer: if not capture: if "[" in text: capture = True text = text[text.index("["):] # Keep from first '[' onward else: continue # Skip until we find '[' outputs.append(text) yield "".join(outputs) demo = gr.ChatInterface( generate, chatbot=gr.Chatbot(placeholder="Greetings human, I am Sum’s Longshadow (v1.1)
I am from the House of the Red Solar Sky
Let’s explore the great mysteries together…."), retry_btn=None, textbox=gr.Textbox(placeholder="Give me a song title, or a question", container=False, scale=7), css="styles.css", additional_inputs=[ gr.Slider( label="Max new tokens", minimum=1, maximum=MAX_MAX_NEW_TOKENS, step=1, value=DEFAULT_MAX_NEW_TOKENS, ), gr.Slider(minimum=0.1, maximum=2.0, value=1.3, step=0.1, label="Temperature"), gr.Slider( minimum=0.1, maximum=1.0, value=0.8, step=0.9, label="Top-p (nucleus sampling)", ), gr.Slider( label="Top-k", minimum=1, maximum=1000, step=1, value=50, ), gr.Slider( label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.1, ), ], ) if __name__ == "__main__": demo.launch()