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

Change temp file name for server application #1535

Merged
merged 1 commit into from Nov 22, 2023

Conversation

felrock
Copy link
Collaborator

@felrock felrock commented Nov 21, 2023

Avoid issue of removing file if it exists in the current working directory.

@felrock
Copy link
Collaborator Author

felrock commented Nov 21, 2023

Sorry for adding these changes one by one!! Not very good practice of me, will try to gather them next time.

Avoid issue of removing file if it exists in the current working
directory
@bobqianic
Copy link
Collaborator

I believe we can just tweak the read_wav() function in common.cpp to enable it to directly read WAV files from RAM, bypassing the need to write them to disk.

The buffer should contain the contents of the entire wave file, not just the sample data.
*/
DRWAV_API drwav_bool32 drwav_init_memory(drwav* pWav, const void* data, size_t dataSize, const drwav_allocation_callbacks* pAllocationCallbacks);
DRWAV_API drwav_bool32 drwav_init_memory_ex(drwav* pWav, const void* data, size_t dataSize, drwav_chunk_proc onChunk, void* pChunkUserData, drwav_uint32 flags, const drwav_allocation_callbacks* pAllocationCallbacks);

@felrock
Copy link
Collaborator Author

felrock commented Nov 21, 2023

Yes, I tried it for a while with no success dr_wav is not a very versatile lib imo. For the server to scale that is a really nice improvement, but for just running it locally the time to read/save file is marginal to the actual time of the inference.

@felrock felrock merged commit 5c7be85 into ggerganov:master Nov 22, 2023
36 checks passed
landtanin pushed a commit to landtanin/whisper.cpp that referenced this pull request Dec 16, 2023
Avoid issue of removing file if it exists in the current working
directory
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.

None yet

2 participants