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

window环境 如何替换 听 说 呀,库已经安装好了 #4

Open
weigtman opened this issue Dec 11, 2023 · 5 comments
Open

window环境 如何替换 听 说 呀,库已经安装好了 #4

weigtman opened this issue Dec 11, 2023 · 5 comments

Comments

@weigtman
Copy link

No description provided.

@weigtman weigtman changed the title window环境 如何替换呀 window环境 如何替换 听 说 呀,库已经安装好了 Dec 11, 2023
@Is-Jiejie
Copy link

请问你在windows环境下如何安装的mlx库呀,是在anaconda中安装的吗。我在pycharm中使用python3.8,除了mlx其余库都可以安装,但是mlx始终无法安装

@Yeeler
Copy link

Yeeler commented Jan 17, 2024

To install from PyPI you must meet the following requirements:

  • Using an M series chip (Apple silicon)
  • Using a native Python >= 3.8
  • macOS >= 13.3

MLX is only available on devices running macOS >= 13.3 It is highly recommended to use macOS 14 (Sonoma)
https://ml-explore.github.io/mlx/build/html/install.html

@Yeeler
Copy link

Yeeler commented Jan 17, 2024

@linyiLYi Is there an alternative lib we can use? I don't have a up-to-date MacOS machine.

@owlsan49
Copy link

owlsan49 commented Apr 4, 2024

mlx是mac专用的机器学习库,windows版得改代码

@onedollor
Copy link

onedollor commented Apr 16, 2024

可以考虑用openai的whisper替换掉whisper目录.

几行code改动,还有貌似torch在cuda 12.4上还有问题,只好用nightly的.

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
torch-2.4.0.dev20240416%2Bcu121-cp39-cp39-win_amd64.whl
tensor([0.], device='cuda:0')
True

还需要ffmpeg,安装可以按照ffmpeg

whisper_model = whisper.load_model("large", download_root=f"{MODEL_ROOT}/openai/whisper")

user_input = whisper_model.transcribe("recordings/output.wav")["text"]

C:\Python\Python39\python.exe I:/AI/code/voice-assistant-main/main.py
torch.cuda.is_available()=>True torch.zeros(1).cuda()=>tensor([0.], device='cuda:0')
好测试再一次测试
Listening...

Error in text-to-speech: [WinError 2] The system cannot find the file specified

speech 部分用以下替换(仅仅用于测试,不连贯,也听起来很傻)

from gtts import gTTS
from pygame import mixer
mixer.init()
import tempfile

    except Exception as e:
        print(f"Error in text-to-speech: {e}")
        self.speak(text, lang="zh-cn")

def speak(self, text, lang):
    with tempfile.NamedTemporaryFile(delete=True) as fp:
        tts = gTTS(text=text, lang=lang)
        tts.save('{}.mp3'.format(fp.name))
        mixer.music.load('{}.mp3'.format(fp.name))
        mixer.music.play(1)

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

No branches or pull requests

5 participants