keivalya commited on
Commit
c2ba00e
·
verified ·
1 Parent(s): 1a10e5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -10,6 +10,20 @@ from scipy.io.wavfile import write
10
  # Load environment variables from .env file
11
  # load_dotenv()
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  def analyze_song(mp3_file):
14
  # Call the transcription function and get the transcription
15
  # Pass the mp3 filename to transcript.py
 
10
  # Load environment variables from .env file
11
  # load_dotenv()
12
 
13
+ def song_history(message):
14
+ question = "Tell me the history of the song: " + message
15
+ completion = client.chat.completions.create(
16
+ model="llama3-8b-8192",
17
+ messages=[question],
18
+ temperature=1,
19
+ max_completion_tokens=1024,
20
+ top_p=1,
21
+ stream=True,
22
+ stop=None,
23
+ )
24
+ for chunk in completion:
25
+ return chunk.choices[0].delta.content or ""
26
+
27
  def analyze_song(mp3_file):
28
  # Call the transcription function and get the transcription
29
  # Pass the mp3 filename to transcript.py