Views
No views yet
1pip install torch transformers accelerate soundfile huggingface_hub
2huggingface-cli login # Gemma 4 is gated — accept license on HF first
3
4git clone https://github.com/g-hano/gemma-voice.git
5cd gemma-voice
6pip install -e .
7cd src1from pathlib import Path
2from huggingface_hub import snapshot_download
3import soundfile as sf
4
5repo = snapshot_download("Chan-Y/gemma4-turkish-speech-e2b-mimi")
6# clone this repo or copy gemma_turkish package next to your script, then:
7import sys
8sys.path.insert(0, str(Path(repo) / "src"))
9
10from gemma_turkish.speech.config import SpeechTrainConfig
11from gemma_turkish.speech.model import GemmaSpeechModel
12import json, torch
13
14repo = Path(repo)
15cfg = SpeechTrainConfig.from_dict(json.loads((repo / "config.json").read_text()))
16model = GemmaSpeechModel(cfg)
17GemmaSpeechModel.load_trainable_checkpoint(model, repo / "speech_head.pt")
18model = model.cuda().eval()
19
20text = "Merhaba, bu bir Türkçe ses sentezi denemesidir."
21wave = model.synthesize(text)
22sf.write("out.wav", wave.squeeze().numpy(), cfg.mimi_sample_rate)python inference.py -t "Merhaba dünya."| File | Description |
|---|---|
speech_head.pt | Merged trainable weights (layer_mix + speech_head) + embedded config |
config.json | Full training/inference hyperparameters |
src/gemma_turkish/ | Model loading & synthesis code |