Thiagohgl / ai-pronunciation-trainer

This tool uses AI to evaluate your pronunciation.
GNU Affero General Public License v3.0
135 stars 38 forks source link

Server Error #1

Open rahulkarda opened 1 year ago

rahulkarda commented 1 year ago

Server error. Either the daily quota of the server is over or there was some internal error. You can try to generate a new sample in a few seconds. If the error persist, try comming back tomorrow or download the local version from Github :)

userMak commented 11 months ago

are you trying to play it locally? if not have you found a solution?

rahulkarda commented 11 months ago

are you trying to play it locally? if not have you found a solution?

Yes running it locally. No solution found yet.

userMak commented 11 months ago

that's a same. We are so close and so far at the same time

pratapyash commented 4 months ago

@Thiagohgl, Is there any solution to this? I've been attempting to run it locally, but I consistently encounter server error 500.

nguyenchiminhhieu commented 4 months ago

@Thiagohgl I also encountered the same problem. Please give me a solution. Thank you

Alehandreus commented 3 months ago

@Thiagohgl I also encountered the same problem. Please give me a solution. Thank you

I did some digging, added try - except and located the error. It occurs at nn_output = self.model(audio) line in AIModels.py file:

RuntimeError: stft requires the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release.

Looks like silero models do have problems with newer PyTorch versions.

I got it working on torch 1.13.1.

nguyenchiminhhieu commented 3 months ago

@Alehandreus Ảnh chụp màn hình 2024-06-04 213017 Thank you for your enthusiasm. I have downgraded the version of pytorch to 1.13.1. Run on localhost after recording is finished, it displays as a picture ...

Alehandreus commented 3 months ago

There is a function GetAccuracyFromRecordedAudio in webApp.py that is responsible for sending the audio. You can add try-except here and see what it prints (just like I did):

@app.route(rootPath+'/GetAccuracyFromRecordedAudio', methods=['POST'])
def GetAccuracyFromRecordedAudio():
    try:
        event = {'body': json.dumps(request.get_json(force=True))}
        lambda_correct_output = lambdaSpeechToScore.lambda_handler(event, [])
    except Exception as e:
        import traceback
        print(e)
        print(traceback.format_exc())
    return lambda_correct_output

Chances are this time it's about np.int which is deprecated. You need to replace two occurrences of np.int with int in WordMatching.py.

nguyenchiminhhieu commented 3 months ago

@Alehandreus It's awesome. Can you give me a reference to this project of yours

Alehandreus commented 3 months ago

Somebody have already fixed np.int issue: fork, pull request If you need the exact place to insert try-except, you can find it in my fork or in commit changes

nidhi10s commented 1 month ago

@Alehandreus @nguyenchiminhhieu did it run locally for you? i am still getting the server error.