Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio.themes import Soft
|
3 |
import os
|
4 |
-
|
5 |
from transcript import transcribe_audio # Import the transcription function
|
6 |
from metadata import info
|
7 |
import numpy as np
|
@@ -10,9 +10,9 @@ from scipy.io.wavfile import write
|
|
10 |
from groq import Groq
|
11 |
|
12 |
# Load environment variables from .env file
|
13 |
-
|
14 |
client = Groq(
|
15 |
-
api_key="
|
16 |
)
|
17 |
|
18 |
def song_history(message):
|
@@ -45,7 +45,7 @@ def analyze_song(mp3_file):
|
|
45 |
os.makedirs("out", exist_ok=True)
|
46 |
write('test.wav', mp3_file[0], mp3_file[1])
|
47 |
data = {
|
48 |
-
'api_token':
|
49 |
'return': 'apple_music,spotify',
|
50 |
}
|
51 |
files = {
|
|
|
1 |
import gradio as gr
|
2 |
from gradio.themes import Soft
|
3 |
import os
|
4 |
+
from dotenv import load_dotenv
|
5 |
from transcript import transcribe_audio # Import the transcription function
|
6 |
from metadata import info
|
7 |
import numpy as np
|
|
|
10 |
from groq import Groq
|
11 |
|
12 |
# Load environment variables from .env file
|
13 |
+
load_dotenv()
|
14 |
client = Groq(
|
15 |
+
api_key=os.environ["GROQ_API_KEY"],
|
16 |
)
|
17 |
|
18 |
def song_history(message):
|
|
|
45 |
os.makedirs("out", exist_ok=True)
|
46 |
write('test.wav', mp3_file[0], mp3_file[1])
|
47 |
data = {
|
48 |
+
'api_token': os.environ["AUDD_API"],
|
49 |
'return': 'apple_music,spotify',
|
50 |
}
|
51 |
files = {
|