Git Product home page Git Product logo

Comments (6)

IVIiracle avatar IVIiracle commented on August 12, 2024 1

Вы можете установить язык с помощью параметра language в функции transcribe:

 result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available(), language="ru")

Список доступных языков можно найти здесь: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L10

You can set the language with the language parameter in the transcribe function:

 result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available(), language="ru")

The list of available languages is here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L10

Спасибо большое, все получилось. У меня вышло компилировать лишь с помощью Nuitka, но главное, что получилось.

from whisper_real_time.

davabase avatar davabase commented on August 12, 2024

По умолчанию whisper.load_model(model) будет помещать модели в папку кэша, ~/.cache/whisper в Linux и Mac и C:\Users\USER\.cache\whisper в Windows. Вам не нужно ничего делать, модели будут загружены в эту папку, когда будет вызвана функция load_model.

Вы можете указать каталог для загрузки модели, используя параметр download_root:

whisper.load_model(model, download_root='download/models/here')

Теперь модели будут загружаться в указанный каталог.

Если вы хотите загрузить уже загруженную модель, вы можете передать путь к файлу контрольной точки вместо имени модели:

whisper.load_model('path/to/base.pt')

В моем проекте transcriber_app я использую cx_Freeze, чтобы упаковать программу в exe. Вы можете посмотреть скрипт настройки в качестве примера того, как использовать cx_Freeze, но это для графического приложения, а не для консольной программы. cx_Freeze будет упаковывать все зависимости Python вместе с исполняемым файлом Python в exe, но учтите, что версия PyTorch для CUDA занимает более гигабайта, поэтому exe-файл будет большим.


By default whisper.load_model(model) will put the models in a cache folder, ~/.cache/whisper on Linux and Mac and C:\Users\USER\.cache\whisper on Windows. You do not have to do anything, the models will be downloaded to this folder when the load_model is called.

You can specify which directory to download the model to by using the download_root parameter:

whisper.load_model(model, download_root='download/models/here')

Now the models will be downloaded to the specified directory.

If you want to load an already downloaded model you can pass the path to the checkpoint file instead of a model name:

whisper.load_model('path/to/base.pt')

In my transcriber_app project I use cx_Freeze to package the program as an exe. You can see the setup script used as an example of how to use cx_Freeze but this is for a GUI app, not a console program. cx_Freeze will package all the python dependencies along with the python executable into an exe, but beware the CUDA version of PyTorch is over a gigabyte in size so the exe will be large.

from whisper_real_time.

IVIiracle avatar IVIiracle commented on August 12, 2024

Спасибо большое, что все так детально пояснил. У меня получилось указать место для модели, а вот с компиляцией пока вопрос. Сам процесс проходит нормально, но итоговый файл запускается и сразу выключается. Может нужен графический интерфейс?

Вопрос, как в твоем коде поставить язык для модели whisper?

from whisper_real_time.

davabase avatar davabase commented on August 12, 2024

Вы можете установить язык с помощью параметра language в функции transcribe:

 result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available(), language="ru")

Список доступных языков можно найти здесь: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L10


You can set the language with the language parameter in the transcribe function:

 result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available(), language="ru")

The list of available languages is here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L10

from whisper_real_time.

olawalejuwonm avatar olawalejuwonm commented on August 12, 2024

is there any update on this?

from whisper_real_time.

olawalejuwonm avatar olawalejuwonm commented on August 12, 2024

can it be converted to desktop app now?

from whisper_real_time.

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.