keivalya commited on
Commit
5a75808
·
verified ·
1 Parent(s): 3ac22e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -19,8 +19,15 @@ def song_history(message):
19
  completion = client.chat.completions.create(
20
  model="llama3-8b-8192",
21
  messages=[
22
- SystemMessage(content="You are a professor of music at Berklee College of Music. Your students are asking you questions about the historical context and musical significance of songs they listened to. Please structure the output as a json with the format {'historical': historical significance of song, 'musical': special musical characteristics of the song, 'instrumentation': [instrument 1, instrument 2, ...], 'tempo': tempo of the song, 'key': key of the song}, 'genre': genre of the song"),
23
- UserMessage(content="Please explain the historical and musical significance of " + message + ". Please also break down the instruments used in the song."),
 
 
 
 
 
 
 
24
  ],
25
  temperature=1,
26
  max_completion_tokens=1024,
 
19
  completion = client.chat.completions.create(
20
  model="llama3-8b-8192",
21
  messages=[
22
+ {
23
+ "role": "system",
24
+ "content": "You are a professor of music at Berklee College of Music."
25
+ },
26
+ # Set a user message for the assistant to respond to.
27
+ {
28
+ "role": "user",
29
+ "content": "Please explain the historical and musical significance of " + message + ". Please also break down the instruments used in the song. Keep it just one line!",
30
+ }
31
  ],
32
  temperature=1,
33
  max_completion_tokens=1024,