Code Monkey home page Code Monkey logo

Comments (12)

aarnphm avatar aarnphm commented on May 18, 2024 1

fwiw the preprocess in python is a heuristic one. The way that I have implemented transcribe right now is not very optimized, rather than a proof of concept.

There are a bunch of memcopy that I need to update, esp right now the result of transcribe are from full_get_segment_text, which it returns the whole blob in string.

I have a different approach for running inference, but need some digging around first. Probably will have a PR up soon after.

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

Hi there, You can try with the latest version. The previous few ones has a wheel bug.

from whispercpp.

regstuff avatar regstuff commented on May 18, 2024

Hi,
Installed from pip successfully, but running

from whispercpp import Whisper
w = Whisper.from_pretrained("tiny.en")

Gives the error:

ImportError                               Traceback (most recent call last)
[<ipython-input-3-16f25927a5a0>](https://localhost:8080/#) in <module>
      1 from whispercpp import Whisper
----> 2 w = Whisper.from_pretrained("tiny.en")



[/usr/local/lib/python3.8/dist-packages/whispercpp/__init__.py](https://localhost:8080/#) in from_pretrained(cls, model_name)
     29             )
     30         _ref = object.__new__(cls)
---> 31         _cpp_binding = api.WhisperPreTrainedModel(download_model(model_name))
     32         context = _cpp_binding.context
     33         params = _cpp_binding.params

[/usr/local/lib/python3.8/dist-packages/whispercpp/utils.py](https://localhost:8080/#) in __getattr__(self, item)
    103     def __getattr__(self, item: t.Any) -> t.Any:  # pragma: no cover
    104         if self._module is None:
--> 105             self._module = self._load()
    106         return getattr(self._module, item)
    107 

[/usr/local/lib/python3.8/dist-packages/whispercpp/utils.py](https://localhost:8080/#) in _load(self)
     82         # Import the target module and insert it into the parent's namespace
     83         try:
---> 84             module = importlib.import_module(self.__name__)
     85             self._parent_module_globals[self._local_name] = module
     86             # The additional add to sys.modules ensures library is actually loaded.

[/usr/lib/python3.8/importlib/__init__.py](https://localhost:8080/#) in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

/usr/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _load_unlocked(spec)

/usr/lib/python3.8/importlib/_bootstrap.py in module_from_spec(spec)

/usr/lib/python3.8/importlib/_bootstrap_external.py in create_module(self, spec)

/usr/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/local/lib/python3.8/dist-packages/whispercpp/api.so)

from whispercpp.

regstuff avatar regstuff commented on May 18, 2024

Also the rate of transcription seems extremely slow. Tiny model took 22 seconds to transcribe a 4 second audio. Whisper.cpp does it in little more than a second one a single thread.

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

Are you running this on Colab? Might need a upgrade for GCC and libstdc++

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

what files are you using? On my end it seems the performance are the same. I'm using some of the bigger ogg files from the samples folder.

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

Can you share your preprocessing code?

from whispercpp.

regstuff avatar regstuff commented on May 18, 2024

Yup. On colab. Oddly enough, building the whl seems to work without GCC error.

Regarding the speed, I'm just running your example with a wav file - pcm_s16le format.
wav file

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

Yup. On colab. Oddly enough, building the whl seems to work without GCC error.

The GCC error probably stems from the bazel script that I'm using to compile the binary. It uses clang atm. I haven't tried with GCC yet, but potentially I can just use gcc if that works just fine.

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

cc @regstuff PR is up #11 . However, this is probably just a quick patch.

From local testing it does speed up by 70%. However,it still doesn't do very well with bigger file. I will create an issue for this.

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

Tracking in #12. I will close this and release 0.0.7 for the quick patch

from whispercpp.

aarnphm avatar aarnphm commented on May 18, 2024

You can try out 0.0.7

from whispercpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.