Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,16 +43,11 @@ def process_media(media_id, access_token, phone_no_id, phone_no,business_id):
|
|
43 |
def audio_transcribe(audio_path):
|
44 |
try:
|
45 |
# Load and preprocess audio
|
46 |
-
|
47 |
-
|
|
|
48 |
|
49 |
-
|
50 |
-
with torch.no_grad():
|
51 |
-
logits = model(input_values).logits
|
52 |
-
predicted_ids = torch.argmax(logits, dim=-1)
|
53 |
-
transcription = processor.batch_decode(predicted_ids)[0]
|
54 |
-
|
55 |
-
return transcription
|
56 |
except Exception as e:
|
57 |
return f"Error: {str(e)}"
|
58 |
|
|
|
43 |
def audio_transcribe(audio_path):
|
44 |
try:
|
45 |
# Load and preprocess audio
|
46 |
+
aai.settings.api_key = "c3db74329eea4ff68b95888dca1e2d72"
|
47 |
+
transcriber = aai.Transcriber()
|
48 |
+
transcript = transcriber.transcribe(audio_path)
|
49 |
|
50 |
+
return transcript
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
except Exception as e:
|
52 |
return f"Error: {str(e)}"
|
53 |
|