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

add an openai compatible api #60

Merged
merged 2 commits into from Dec 1, 2023
Merged

add an openai compatible api #60

merged 2 commits into from Dec 1, 2023

Conversation

lewangdev
Copy link
Contributor

No description provided.

@lewangdev
Copy link
Contributor Author

#42

@syq163
Copy link
Collaborator

syq163 commented Nov 30, 2023

Great job! I'm excited to set up the environment, but I encountered an issue with Python 3.8. Could you please confirm if PR is compatible with Python 3.8, as it's the recommended version to run with EmotiVoice?

@lewangdev
Copy link
Contributor Author

OK,I will test it on Python 3.8.

@lewangdev
Copy link
Contributor Author

Hi,
I configured my development environment using the Docker image syq163/emoti-voice:latest, which has Python version 3.10.12.

I used FastAPI to implement the openai compatible API for emoti-voice. And Python 3.10+ has the best and simplest syntax for type hints.

I will change to Python 3.8+ type hints to run with EmotiVoice.

@syq163
Copy link
Collaborator

syq163 commented Dec 1, 2023

Hi, I configured my development environment using the Docker image syq163/emoti-voice:latest, which has Python version 3.10.12.

I used FastAPI to implement the openai compatible API for emoti-voice. And Python 3.10+ has the best and simplest syntax for type hints.

I will change to Python 3.8+ type hints to run with EmotiVoice.

Thank you for the information. Yeah, I agree 3.10+ might be better.

@syq163
Copy link
Collaborator

syq163 commented Dec 1, 2023

I have tried Python 3.10 and it works fine. I have two suggestions:

  1. I have modified the 'openaiapi.py' file to make it compatible with Python 3.8. Please check it.
    openaiapi.txt

  2. I see that you have modified the 'frontend_cn.py' file to make it more robust. However, I suggest that we keep 'frontend_cn.py' unchanged as errors may help us improve it.
    One more thing, it seems that the 'log-config.yml' file is not that necessary, is that right?

@lewangdev
Copy link
Contributor Author

Great!

it's amazing to see that you have already finished the changes so quickly. I'm sorry that I didn't have time today to modify and support Python 3.8.

log-config.yml is unnecessary and can be deleted.

I agree that you keep 'frontend_cn.py' unchanged.

@syq163
Copy link
Collaborator

syq163 commented Dec 1, 2023

Thank you for confirming that. Could you please make the necessary updates as we discussed, so that I can easily merge the PR?

Great!

it's amazing to see that you have already finished the changes so quickly. I'm sorry that I didn't have time today to modify and support Python 3.8.

log-config.yml is unnecessary and can be deleted.

I agree that you keep 'frontend_cn.py' unchanged.

@lewangdev
Copy link
Contributor Author

Thank you for confirming that. Could you please make the necessary updates as we discussed, so that I can easily merge the PR?

Great!
it's amazing to see that you have already finished the changes so quickly. I'm sorry that I didn't have time today to modify and support Python 3.8.
log-config.yml is unnecessary and can be deleted.
I agree that you keep 'frontend_cn.py' unchanged.

ok.

@lewangdev
Copy link
Contributor Author

Hi, the PR has been updated.

@syq163 syq163 merged commit 857f2b2 into netease-youdao:main Dec 1, 2023
@syq163
Copy link
Collaborator

syq163 commented Dec 1, 2023

Thank you and all the best!

@lucasjinreal
Copy link

Hi, this is good, but if there is no-stream support, we can not say supported openai API now.

At least 2 things not done:

  1. Chinese support;
  2. streaming tts support;

@newbei
Copy link

newbei commented Apr 11, 2024

Can give a demo?

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.

Feature request: clean the code and make a fastapi just like OpenAI's tts API
4 participants