-
Notifications
You must be signed in to change notification settings - Fork 3
Elevenlabs asr integration #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe code integrates the ElevenLabs Scribe v1 ASR model into the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
daras_ai_v2/asr.py (1)
988-1016: Remove redundant imports and consider memory usage.The function implementation is solid with proper error handling, but has a couple of issues:
- Redundant imports:
requestsandsettingsare already imported at the file level (lines 12 and 18).- Memory consideration: Loading the entire audio file into memory could be problematic for large files.
Apply this diff to remove redundant imports:
def elevenlabs_asr(audio_url: str, language: str = None) -> dict: """ Call ElevenLabs Speech-to-Text API """ - import requests - from daras_ai_v2 import settings - audio_r = requests.get(audio_url)The memory usage for large files is acceptable given that other ASR functions in this file follow the same pattern.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
daras_ai_v2/asr.py(6 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
daras_ai_v2/asr.py (1)
daras_ai_v2/exceptions.py (1)
raise_for_status(19-49)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (actions)
- GitHub Check: test (3.10.12, 1.8.3)
🔇 Additional comments (5)
daras_ai_v2/asr.py (5)
124-133: LGTM! Well-structured language support definition.The ElevenLabs supported languages set follows the established pattern in the codebase, using 3-letter ISO codes in a set for efficient membership testing. The format is consistent with other language definitions in the file.
274-274: LGTM! Consistent enum member addition.The new enum member follows the established naming convention and clearly identifies the ElevenLabs model.
344-344: LGTM! Proper model ID mapping.The mapping follows the established pattern in the
asr_model_idsdictionary and uses an appropriate identifier for the ElevenLabs model.
370-370: LGTM! Correct language mapping.The mapping properly associates the ElevenLabs model with its supported language set, maintaining consistency with other model mappings.
1064-1080: LGTM! Well-implemented ElevenLabs integration.The ElevenLabs branch in
run_asrfollows the established pattern and properly handles both text and JSON output formats. The chunk processing logic appropriately extracts timestamps, text, and speaker information with sensible defaults.The conditional speaker assignment (
if word_data["type"] == "word") suggests the API may return different data types, which is handled correctly.
… elevenlabs-asr-integration
Q/A checklist
How to check import time?
You can visualize this using tuna:
To measure import time for a specific library:
To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:
Legal Boilerplate
Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.