Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import tempfile
|
|
7 |
from nltk.tokenize import sent_tokenize
|
8 |
import random
|
9 |
from groq import Groq
|
10 |
-
|
11 |
# Attempt to download punkt tokenizer
|
12 |
try:
|
13 |
nltk.download("punkt")
|
@@ -23,7 +23,7 @@ def transcribe(audio_path):
|
|
23 |
|
24 |
groq_api_endpoint = "https://api.groq.com/openai/v1/audio/transcriptions"
|
25 |
headers = {
|
26 |
-
"Authorization": "Bearer
|
27 |
}
|
28 |
files = {
|
29 |
'file': ('audio.wav', audio_data, 'audio/wav'),
|
|
|
7 |
from nltk.tokenize import sent_tokenize
|
8 |
import random
|
9 |
from groq import Groq
|
10 |
+
api_key=os.environ.get("GROQ_API_KEY")
|
11 |
# Attempt to download punkt tokenizer
|
12 |
try:
|
13 |
nltk.download("punkt")
|
|
|
23 |
|
24 |
groq_api_endpoint = "https://api.groq.com/openai/v1/audio/transcriptions"
|
25 |
headers = {
|
26 |
+
"Authorization": "Bearer api_key", # Replace with your actual API key
|
27 |
}
|
28 |
files = {
|
29 |
'file': ('audio.wav', audio_data, 'audio/wav'),
|