Code Monkey home page Code Monkey logo

Comments (8)

antlarr avatar antlarr commented on July 30, 2024 1

Hi, I had the same problem as @Nardol. @synesthesiam , as you said, this is a difference in Python 3.11 where you now have to replace:
model_url = URL_FORMAT.format(model=model)
with
model_url = URL_FORMAT.format(model=model.value)
in download.py (in download_model)

As @Nardol , I also didn't find the source code to make a PR. Could you point us to where it is? Even if you've probably already fixed this, it would be nice to know where it is, just in case someone wants to submit some other fix/improvement.

Thanks!

from rhasspy3.

taha-yassine avatar taha-yassine commented on July 30, 2024 1

Hi, I had the same problem as @Nardol. @synesthesiam , as you said, this is a difference in Python 3.11 where you now have to replace: model_url = URL_FORMAT.format(model=model) with model_url = URL_FORMAT.format(model=model.value) in download.py (in download_model)

As @Nardol , I also didn't find the source code to make a PR. Could you point us to where it is? Even if you've probably already fixed this, it would be nice to know where it is, just in case someone wants to submit some other fix/improvement.

Thanks!

I'm answering since no one did. The source code is sitting over in the v0.1.0 branch. It can be found here: https://github.com/rhasspy/rhasspy3/blob/v0.1.0/programs/asr/faster-whisper/script/download.py

from rhasspy3.

synesthesiam avatar synesthesiam commented on July 30, 2024

The "medium" model is not available here: https://github.com/rhasspy/models/releases/tag/v1.0
It was quite large, so I didn't upload it or the large model.

You can create it yourself by following these steps: https://github.com/guillaumekln/faster-whisper#model-conversion

from rhasspy3.

Nardol avatar Nardol commented on July 30, 2024

Before trying procedure you linked to, I've just tested with tiny-int8 to test with smaller before but with the same 404 result.
What do I do wrong?
python3 -m wyoming_faster_whisper --uri 'tcp://0.0.0.0:10300' --model tiny-int8 --beam-size "1" --language "fr" --data-dir ./data --download-dir ./data

from rhasspy3.

synesthesiam avatar synesthesiam commented on July 30, 2024

Weird. Can you get the full URL it's trying for the model?

from rhasspy3.

Nardol avatar Nardol commented on July 30, 2024

I added a print(model_url) before the urlopen which gave me the following:
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-FasterWhisperModel.TINY_INT8.tar.gz
The dash is replaced by a period if using model instead of model.value.
Python version 3.11.2
I have not found where the source code is to make a PR.

from rhasspy3.

synesthesiam avatar synesthesiam commented on July 30, 2024

Ok, so this must be a difference with enums and Python 3.11. Thanks!

from rhasspy3.

mweinelt avatar mweinelt commented on July 30, 2024

Ok, so this must be a difference with enums and Python 3.11. Thanks!

That's spot on, tested using the following reproducer. Should be patched to use the value accessor as indicated by @antlarr. The code is on the wyoming-v1 branch.

from enum import Enum

URL_FORMAT = "https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-{model}.tar.gz"

class FasterWhisperModel(str, Enum):
    """Available faster-whisper models."""

    TINY = "tiny"
    TINY_INT8 = "tiny-int8"
    BASE = "base"
    BASE_INT8 = "base-int8"
    SMALL = "small"
    SMALL_INT8 = "small-int8"
    MEDIUM = "medium"
    MEDIUM_INT8 = "medium-int8"


tiny = FasterWhisperModel.TINY

print(URL_FORMAT.format(model=tiny))
print(URL_FORMAT.format(model=tiny.value))
$ python3.8 enumtest.py
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
$ python3.9 enumtest.py
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
$ python3.10 enumtest.py
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
$ python3.11 enumtest.py
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-FasterWhisperModel.TINY.tar.gz
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz
$ python3.12 enumtest.py
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-FasterWhisperModel.TINY.tar.gz
https://github.com/rhasspy/models/releases/download/v1.0/asr_faster-whisper-tiny.tar.gz

from rhasspy3.

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.