Comments (3)
-
I didn't try this CoreML feature because I don't have a MAC so I won't be able to test it.
But I think you can just update thewhisper.cpp
submodule as well as thecmakelists.txt
file and build the project from source. -
Thank you for the suggestion. I tried to create a discussion in the
whisper.cpp
repo to showcase the library features, but I think the developers didn't want to add it to the bindings list in the readme page!! Maybe it is not as good as the ones already there!
from pywhispercpp.
@abdeladim-s or @RageshAntony ,
I also have a M2 mac and have been working with whisper.cpp utilizing the GPU. However, I have not been able to do so with the pywhispercpp. Is there a more indepth guide or explanation available to use as a reference?
I also have made some modifications to your /examples/main.py to allow output to json:
if args.output_json:
logging.info(f"Saving results as a json file ...")
json_file = utils.output_json(segs, file)
logging.info(f"json file saved to {json_file}")
and
parser.add_argument('-ojson', '--output-json', action='store_true', help="output result in a json file")
I also made changes to the utils.py:
def output_json(segments: list, output_file_path: str) -> str:
"""
Creates a JSON file from a list of segments
:param segments: list of segments
:return: path of the file
:return: Absolute path of the file
"""
if not output_file_path.endswith('.json'):
output_file_path = output_file_path + '.json'
absolute_path = Path(output_file_path).absolute()
# Convert segments to a list of dictionaries
segments_json = []
for seg in segments:
segment_dict = {
"start_time": seg.t0,
"end_time": seg.t1,
"text": seg.text
}
segments_json.append(segment_dict)
# Write the list of segment dictionaries to the JSON file
with open(absolute_path, 'w', encoding='utf-8') as file:
json.dump(segments_json, file, ensure_ascii=False, indent=4)
return absolute_path
Here is json output for the /samples/jfk.wav as an example. Thanks again for your work.
[
{
"start_time": 0,
"end_time": 1100,
"text": "And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country."
}
]
from pywhispercpp.
Thanks @w0372299 for the Json Idea, it looks great, please submit a PR and I will merge it with the codebase.
Regarding your question, as I said, I really wish I can help but I don't have access to a MAC.
I think the good use case for whisper.cpp
is to use it with CPU, if you want to use the GPU just use the original whisper
with Pytorch (it is already optimized for GPU) or even better use Faster-whisper
, it supports the GPU and provides better performance.
from pywhispercpp.
Related Issues (20)
- "Cannot find source file: ggml.h" when trying to install on Ubuntu 22.04 on aarch64 HOT 3
- Integrating pywhispercpp as the first extension to lollms-webui HOT 2
- Nothing happens HOT 13
- pywhispercpp/whisper.cpp/ggml-opencl.c:4:10: fatal error: 'clblast_c.h' file not found #include <clblast_c.h> HOT 9
- ERROR - Invalid model name `./model.bin` HOT 1
- ERROR - unable to initialize from path HOT 5
- Unable to install on raspberry pi 4 HOT 5
- How to add space between subtitles? HOT 1
- word-level timestamps? HOT 5
- About GPU question HOT 1
- Using the agent for interacting with ollama models HOT 29
- Tool is super slow / runs forever HOT 10
- Unable to load `quantized` models HOT 3
- _pywhispercpp module could not be found HOT 28
- "ggml-metal.metal" file couldn't be found when loading the large-v3 model for CoreML HOT 7
- failed to compute log mel spectrogram HOT 3
- Installation from source leads to non-functional installation HOT 17
- Unknown language error HOT 4
- How to make transcription and speaker diarization using pywhispercpp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pywhispercpp.