pn23 commited on
Commit
9e5bc96
·
verified ·
1 Parent(s): 10ace3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -37,38 +37,38 @@ if "messages" not in st.session_state:
37
  init_alr = False
38
 
39
  def init_model(user_input):
40
- # os.environ["API_KEY"] = "AIzaSyAgqODyVqcqlsDC1Gzuy8TkpiWnQZVGovw"
41
- # genai.configure(api_key=os.environ.get("API_KEY"))
42
- # model = genai.GenerativeModel('gemini-pro')
43
 
44
- # userInput = user_input #"Give me an afrofunk beat along with a cool melody and catchy drums, along with an opera style"
45
- # prompt = userInput + ". Output ONLY the specific music genre that the user would like that fits their requirements, with no excess words. Simply the genre, NO APOSTROPHES. If required, add more than one genre to best fit the user's prompt by adding a comma and space and a another genre. Desired Output: <all_lowercase_comma_separated_genres>"
46
- # response = model.generate_content(prompt)
47
- # genre = response.text
48
 
49
- # userInput = "Genre: " + genre + ". Generate lyrics that would best fit into the required genre. The lyrics should not be about the genre, but would best fit into the genre. Generate around 1 minutes worth of lyrics. Separate verses using [Verse #] and NO APOSTROPHES AT ALL. If you must use them, please remove them from the word, even if it mispells the word. Desired Format: <seperate_each_verse_no_asteriks_or_apostrophes>"
50
- # response = model.generate_content(userInput)
51
- # lyrics = response.text
52
 
53
- # lyricInput = "Lyrics: " + lyrics + ". Based upon the following lyrics, please generate a title for this song. Desired Format: <title_case_without_genre>"
54
- # response = model.generate_content(lyricInput)
55
- # title = response.text
56
 
57
- # userInput = "Lyrics: " + lyrics + ". Split the following lyrics into ONLY 10 slices with each slice enhanced to describe a music video. You may slightlly alter the lyrics to best cater to this requirment. Each section is separated by a |. Use only 10 |'s. Delete ALL \n characters and Verse seperators as well. Desired Output: <|_separated>"
58
- # response = model.generate_content(userInput)
59
- # sepTen = response.text
60
- # whollySplit = sepTen.split("|")
61
 
62
- #Add code for list of frame
63
- #call separate script for frame generation
64
- #gen_movie(whollySplit[:10])
65
 
66
  #make API request
67
 
68
- #TODO
69
 
70
  #call webscraping script
71
- get_mp3("Samba Kickoff")
72
 
73
  return genre
74
 
 
37
  init_alr = False
38
 
39
  def init_model(user_input):
40
+ os.environ["API_KEY"] = "AIzaSyAgqODyVqcqlsDC1Gzuy8TkpiWnQZVGovw"
41
+ genai.configure(api_key=os.environ.get("API_KEY"))
42
+ model = genai.GenerativeModel('gemini-pro')
43
 
44
+ userInput = user_input #"Give me an afrofunk beat along with a cool melody and catchy drums, along with an opera style"
45
+ prompt = userInput + ". Output ONLY the specific music genre that the user would like that fits their requirements, with no excess words. Simply the genre, NO APOSTROPHES. If required, add more than one genre to best fit the user's prompt by adding a comma and space and a another genre. Desired Output: <all_lowercase_comma_separated_genres>"
46
+ response = model.generate_content(prompt)
47
+ genre = response.text
48
 
49
+ userInput = "Genre: " + genre + ". Generate lyrics that would best fit into the required genre. The lyrics should not be about the genre, but would best fit into the genre. Generate around 1 minutes worth of lyrics. Separate verses using [Verse #] and NO APOSTROPHES AT ALL. If you must use them, please remove them from the word, even if it mispells the word. Desired Format: <seperate_each_verse_no_asteriks_or_apostrophes>"
50
+ response = model.generate_content(userInput)
51
+ lyrics = response.text
52
 
53
+ lyricInput = "Lyrics: " + lyrics + ". Based upon the following lyrics, please generate a title for this song. Desired Format: <title_case_without_genre>"
54
+ response = model.generate_content(lyricInput)
55
+ title = response.text
56
 
57
+ userInput = "Lyrics: " + lyrics + ". Split the following lyrics into ONLY 10 slices with each slice enhanced to describe a music video. You may slightlly alter the lyrics to best cater to this requirment. Each section is separated by a |. Use only 10 |'s. Delete ALL \n characters and Verse seperators as well. Desired Output: <|_separated>"
58
+ response = model.generate_content(userInput)
59
+ sepTen = response.text
60
+ whollySplit = sepTen.split("|")
61
 
62
+ Add code for list of frame
63
+ call separate script for frame generation
64
+ gen_movie(whollySplit[:10])
65
 
66
  #make API request
67
 
68
+
69
 
70
  #call webscraping script
71
+ #get_mp3("Samba Kickoff")
72
 
73
  return genre
74