Skip to content

A simple python program that utlizes two AI models to create music based on your feelings.

License

Notifications You must be signed in to change notification settings

Mousemaster12/TheraMusic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Theramusic Python Script Overview

This Python script interacts with the unofficial gcui-art/suno-api API and Cloudflare AI to generate therapeutic music based on user input. It utilizes different functions to communicate with the server and Cloudflare AI, generating audio based on user-provided mood or emotion.

##Requirements

Python 3.x
Requests library (for making HTTP requests)
JSON library (for handling JSON data)
Time library (for adding delays)
The gcui-art/suno-api up and running
pygame for GUI 

Setup

Install Python if not already installed. You can download it from here. Install the Requests library and pygame using pip:

pip install requests
pip install pygame

Usage

Run the script in a Python environment. Enter the user's mood or emotion when prompted. The script will generate a prompt for Cloudflare AI based on the user input, and then generate therapeutic music. The generated audio will be streamed after a short delay.

Functions

custom_generate_audio(payload): Generates audio using custom parameters.
generate_audio_by_prompt(payload): Generates audio using a prompt.
get_audio_information(audio_ids): Retrieves audio information by audio IDs.
get_quota_information(): Retrieves quota information.

Cloudflare AI Model

The script utilizes a Cloudflare AI model (@cf/meta/llama-2-7b-chat-int8) to process user input and generate prompts for the music generator.

Notes

Ensure that the local gcui-art/suno-api server is running and accessible at http://localhost:3000. Cloudflare AI authentication details (ID and KEY) must be provided for accessing the Cloudflare AI model, using an .env file The generated prompt should be therapeutic, optimistic, and relevant to the user's input. The script waits for the audio to be generated and streamed before displaying the audio URLs.

About

A simple python program that utlizes two AI models to create music based on your feelings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages