Spaces:
Runtime error
Runtime error
Update app.py
Browse files30 unmodified lines31323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314 unmodified lines15815916016116216324 unmodified lines18818919019119219319430 unmodified lines# Initialize the Hugging Face tokenizer and modelmodel_name = "google/flan-t5-small" # or "t5-small" for an even lighter modeltokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=HUGGINGFACE_API_TOKEN)model = AutoModelForSeq2SeqLM.from_pretrained(model_name, use_auth_token=HUGGINGFACE_API_TOKEN)# Ensure the model runs on CPUdevice = 'cpu'model.to(device)# List of house music hooks to drop randomlyhouse_music_hooks = ["Feeling the vibe, let's get hyped!","Rave or die!","Rave to the g,rave!","He just strutts!","Dancing is what to do!","Let's get riggity riggity wrecked!","Sleep is for the week, not the weekend!","It's hard out here for a pimp!","Something for your mind!","Something for your body!","Something for your soul!","Not everyone understands this thing they call house music!","It's a spiritual thing!","Talkin' about that thing they call house music!","Don't mean a thing if it ain't got that swing!","Can't stop. Won't stop!","Shots! Shots! Shots!","Jack to the sound of the underground!","Jack your body!","Dancing all night long, can't stop the beat!","Got my hands up high, feeling alive!","The music's got me moving, can't resist the groove!","Let's ride this wave, we're on top of the world!","Feeling the energy, let it consume us all!","We're in the zone, lost in the music!","This beat is fire, can't stop dancing!","The rhythm is pumping, let's keep it real!","Get ready to party, we're on a roll!","Let's make some noise, and show them how it's done!","We're living for the moment, feeling alive tonight!","The music's got us hyped, let's keep it real!","We're in the house, and we're here to stay!","Let's rock this place, and make it feel like home!","Got my hands up high, feeling alive tonight!","The beat is strong, and so are we!","We're on the dance floor, living our best lives!","Let's keep the energy high, and the vibes bright!","Feeling the music deep inside my soul!","The rhythm is pumping, let's make it whole!","We're on a roll, can't stop feeling alive!","The music's got us moving, let's keep on dancing!","Got my feet tapping, and my heart is pounding!","Feeling the magic, in every single note!","We're lost in the rhythm, and we can't be stopped!","The music's got us swaying, back and forth!","Let's keep dancing all night long!","Feeling the heat, let it consume me whole!","We're in the zone, can't stop grooving!","The music's got us high, and we won't come down!","Let's keep on moving, until the morning light!","We're in this together, let's make it feel right!","The rhythm is strong, and we can't be stopped!","Feeling the beat, deep inside my soul!","Got my heart racing, and my feet are on fire!","The music's got us moving, let's keep it real!","Feeling the energy, and we won't stop until the break of dawn!","Got my hands up high, feeling alive tonight!","The beat is strong, and so are we!","Got my feet tapping, and my heart is pounding!","Feeling the magic, in every single note!","Let's keep on dancing all night long, feeling alive tonight!","We're lost in the rhythm, and can't be stopped!","Feeling the energy, let it consume me whole!","Got my heart racing, and my feet are on fire!","The music's got us moving, can't stop dancing!","Feeling the beat, deep inside my soul!","Let's keep on dancing, until we reach our goal!","We're on a roll, can't stop living our best lives!","The music's got us moving, can't stop swaying!","Feeling the energy, let it consume me whole!","We're in this together, let's make it feel right!","Got my heart racing, and my feet are on fire!","Feeling the magic, in every single note!","We're lost in the rhythm, and can't be stopped!","The music's got us swaying, back and forth!","Feeling the heat, let it consume me whole!","The beat is strong, and so are we!","We're in this together, let's make it feel right!","Got my feet tapping, and my heart is pounding!","Let's keep dancing all night long, feeling alive tonight!","Feeling the energy, let it take control!","We're lost in the music, can't be found!","Got my hands up high, feeling alive tonight!","Feeling the vibe, let's keep it real!","We're on a roll, can't stop living our best lives!","Got my heart racing, and my feet are on fire!","The music's got us moving, can't stop grooving!","Feeling the magic, in every single note!","We're lost in the rhythm, and can't be stopped!","Got my feet tapping, and my heart is pounding!","Feeling the energy, let it take control!","We're on a roll, can't stop living our best lives!","The beat is strong, and so are we!","Feeling the energy, let it consume me whole!","Got my feet tapping, and my heart is pounding!","Feeling the beat, deep inside my soul!","Let's keep on dancing, until we reach our goal!","Got my heart racing, and my feet are on fire!","The music's got us moving, can't stop dancing!",]14 unmodified linesinputs,max_length=MAX_TOKENS + inputs.shape[1],temperature=TEMPERATURE,num_return_sequences=1,no_repeat_ngram_size=2,early_stopping=True,24 unmodified linesasync def event_message(self, message):"""Event handler when a message is received in chat."""if message.author.name.lower() == self.nick.lower():return # Ignore the bot's own messageslogger.info(f"Message received from {message.author.name}: {message.content}")30 unmodified lines3132333435363738394041424344454647484914 unmodified lines6465666768697071727324 unmodified lines989910010110210310430 unmodified lines# Initialize the Hugging Face tokenizer and modelmodel_name = "google/flan-t5-small" # or "t5-small" for an even lighter modeltokenizer = AutoTokenizer.from_pretrained(model_name, token=HUGGINGFACE_API_TOKEN)model = AutoModelForSeq2SeqLM.from_pretrained(model_name, token=HUGGINGFACE_API_TOKEN)# Ensure the model runs on CPUdevice = 'cpu'model.to(device)# List of house music hooks to drop randomlyHOUSE_MUSIC_HOOKS = ["Feeling the vibe, let's get hyped!","Rave or die!","Rave to the g,rave!","He just strutts!","The music's got us moving, can't stop dancing!",]14 unmodified linesinputs,max_length=MAX_TOKENS + inputs.shape[1],temperature=TEMPERATURE,do_sample=True,top_p=0.9,top_k=50,num_beams=3,num_return_sequences=1,no_repeat_ngram_size=2,early_stopping=True,24 unmodified linesasync def event_message(self, message):"""Event handler when a message is received in chat."""if message.author and message.author.name.lower() == self.nick.lower():return # Ignore the bot's own messageslogger.info(f"Message received from {message.author.name}: {message.content}")
app.py+8-98