Skip to content
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

fetch ghana translation target languages from api #462

Merged
merged 9 commits into from
Sep 19, 2024

Conversation

anish-work
Copy link
Contributor

@anish-work anish-work commented Sep 12, 2024

Q/A checklist

  • If you add new dependencies, did you update the lock file?
poetry lock --no-update
  • Run tests
ulimit -n unlimited && ./scripts/run-tests.sh
  • Do a self code review of the changes - Read the diff at least twice.
  • Carefully think about the stuff that might break because of this change - this sounds obvious but it's easy to forget to do "Go to references" on each function you're changing and see if it's used in a way you didn't expect.
  • The relevant pages still run when you press submit
  • The API for those pages still work (API tab)
  • The public API interface doesn't change if you didn't want it to (check API tab > docs page)
  • Do your UI changes (if applicable) look acceptable on mobile?
  • Ensure you have not regressed the import time unless you have a good reason to do so.
    You can visualize this using tuna:
python3 -X importtime -c 'import server' 2> out.log && tuna out.log

To measure import time for a specific library:

$ time python -c 'import pandas'

________________________________________________________
Executed in    1.15 secs    fish           external
   usr time    2.22 secs   86.00 micros    2.22 secs
   sys time    0.72 secs  613.00 micros    0.72 secs

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:

def my_function():
    import pandas as pd
    ...

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.


daras_ai_v2/asr.py Outdated Show resolved Hide resolved
daras_ai_v2/asr.py Outdated Show resolved Hide resolved
@anish-work anish-work force-pushed the ghana_mt_lang_api branch 2 times, most recently from 6393e24 to 9f0f20a Compare September 18, 2024 09:42
daras_ai_v2/asr.py Outdated Show resolved Hide resolved
@anish-work
Copy link
Contributor Author

@devxpy we have to update the env var for this to work

@devxpy
Copy link
Member

devxpy commented Sep 18, 2024

please fix the tests here. our codebase should not need the ghana nlp API key for these tests to pass

@devxpy
Copy link
Member

devxpy commented Sep 19, 2024

Eg here's what we did for azure & 11labs 85874ee

@anish-work
Copy link
Contributor Author

@devxpy updated please check once

@devxpy
Copy link
Member

devxpy commented Sep 19, 2024

better to at least test the render of the component by passing the available languages as empty like so

def azure_tts_selector():
if settings.AZURE_SPEECH_KEY:
voices = azure_tts_voices()
else:
voices = {}
gui.selectbox(
label="""
###### Azure TTS Voice name
""",
key="azure_voice_name",
format_func=lambda voice: f"{voices[voice].get('DisplayName')} - {voices[voice].get('LocaleName')}",
options=voices.keys(),
)

@devxpy
Copy link
Member

devxpy commented Sep 19, 2024

LGTM, but after testing:

@anish-work anish-work merged commit 9865e5b into master Sep 19, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants