Claude commited on
Commit ·
b75414a
1
Parent(s): 298c77c
Add requirements.txt and installation guide
Browse files- Complete requirements.txt with all dependencies
- Detailed installation guide in Portuguese
- Performance tuning instructions
- Troubleshooting section
- INSTALLATION_GUIDE.md +133 -0
- requirements.txt +67 -0
INSTALLATION_GUIDE.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🚀 Guia Completo de Instalação - LLaMA-Omni2
|
| 2 |
+
|
| 3 |
+
## Pré-requisitos
|
| 4 |
+
- Python 3.10+
|
| 5 |
+
- CUDA 12.1+ (para GPU)
|
| 6 |
+
- 24GB+ VRAM (recomendado RTX A5000 ou superior)
|
| 7 |
+
- Ubuntu 20.04+ ou sistema compatível
|
| 8 |
+
|
| 9 |
+
## Instalação Rápida
|
| 10 |
+
|
| 11 |
+
### 1. Clone o repositório
|
| 12 |
+
```bash
|
| 13 |
+
git clone https://huggingface.co/marcosremar2/llama-omni2-official-code
|
| 14 |
+
cd llama-omni2-official-code
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
### 2. Execute o script de instalação automática
|
| 18 |
+
```bash
|
| 19 |
+
chmod +x install.sh
|
| 20 |
+
./install.sh
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
## Instalação Manual
|
| 24 |
+
|
| 25 |
+
### 1. Crie ambiente virtual
|
| 26 |
+
```bash
|
| 27 |
+
python -m venv venv
|
| 28 |
+
source venv/bin/activate # Linux/Mac
|
| 29 |
+
# ou
|
| 30 |
+
venv\Scripts\activate # Windows
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
### 2. Instale dependências
|
| 34 |
+
```bash
|
| 35 |
+
pip install --upgrade pip
|
| 36 |
+
pip install -r requirements.txt
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
### 3. Instale o projeto
|
| 40 |
+
```bash
|
| 41 |
+
pip install -e .
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
### 4. Baixe os modelos
|
| 45 |
+
|
| 46 |
+
#### Whisper (Reconhecimento de Voz)
|
| 47 |
+
```python
|
| 48 |
+
import whisper
|
| 49 |
+
model = whisper.load_model("base", download_root="models/")
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
#### Qwen 2.5 (LLM)
|
| 53 |
+
```python
|
| 54 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 55 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## Teste Rápido
|
| 60 |
+
|
| 61 |
+
### 1. Teste básico do sistema
|
| 62 |
+
```bash
|
| 63 |
+
python simple_speech_chat.py
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
### 2. Teste com áudio
|
| 67 |
+
```bash
|
| 68 |
+
python generate_test_audios.py
|
| 69 |
+
python test_latency_final.py
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Estrutura do Projeto
|
| 73 |
+
|
| 74 |
+
```
|
| 75 |
+
llama-omni2-official-code/
|
| 76 |
+
├── llama_omni2/ # Módulo principal
|
| 77 |
+
│ ├── model/ # Modelos e arquiteturas
|
| 78 |
+
│ ├── serve/ # Servidor web e APIs
|
| 79 |
+
│ └── inference/ # Scripts de inferência
|
| 80 |
+
├── simple_speech_chat.py # Chat de voz simples
|
| 81 |
+
├── install.sh # Script de instalação
|
| 82 |
+
├── requirements.txt # Dependências Python
|
| 83 |
+
└── pyproject.toml # Configuração do projeto
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Configuração de Performance
|
| 87 |
+
|
| 88 |
+
### Para melhor latência (< 1000ms)
|
| 89 |
+
```python
|
| 90 |
+
# Em simple_speech_chat.py
|
| 91 |
+
whisper_model = "base" # Mais rápido
|
| 92 |
+
max_new_tokens = 20 # Respostas curtas
|
| 93 |
+
temperature = 0.0 # Greedy decoding
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
### Para melhor qualidade
|
| 97 |
+
```python
|
| 98 |
+
whisper_model = "small" # Mais preciso
|
| 99 |
+
max_new_tokens = 50 # Respostas completas
|
| 100 |
+
temperature = 0.7 # Mais criativo
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
## Solução de Problemas
|
| 104 |
+
|
| 105 |
+
### CUDA não disponível
|
| 106 |
+
```bash
|
| 107 |
+
# Verifique CUDA
|
| 108 |
+
python -c "import torch; print(torch.cuda.is_available())"
|
| 109 |
+
|
| 110 |
+
# Reinstale PyTorch com CUDA
|
| 111 |
+
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
### Erro de memória GPU
|
| 115 |
+
- Reduza batch_size
|
| 116 |
+
- Use modelo menor (Qwen 0.5B ao invés de 1.5B)
|
| 117 |
+
- Use quantização (bitsandbytes)
|
| 118 |
+
|
| 119 |
+
### Áudio não funciona
|
| 120 |
+
```bash
|
| 121 |
+
# Instale ffmpeg
|
| 122 |
+
sudo apt-get update && sudo apt-get install -y ffmpeg
|
| 123 |
+
|
| 124 |
+
# Teste gTTS
|
| 125 |
+
python -c "from gtts import gTTS; tts = gTTS('teste', lang='pt'); tts.save('test.mp3')"
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
## Suporte
|
| 129 |
+
- Repositório: https://huggingface.co/marcosremar2/llama-omni2-official-code
|
| 130 |
+
- Issues: Abra uma issue no HuggingFace
|
| 131 |
+
|
| 132 |
+
## Licença
|
| 133 |
+
Apache 2.0 - Veja o arquivo LICENSE para detalhes
|
requirements.txt
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Core dependencies
|
| 2 |
+
torch==2.3.1
|
| 3 |
+
torchaudio==2.3.1
|
| 4 |
+
transformers==4.43.4
|
| 5 |
+
tokenizers==0.19.1
|
| 6 |
+
sentencepiece==0.1.99
|
| 7 |
+
|
| 8 |
+
# LLM dependencies
|
| 9 |
+
accelerate==0.33.0
|
| 10 |
+
peft==0.14.0
|
| 11 |
+
bitsandbytes==0.45.0
|
| 12 |
+
|
| 13 |
+
# Audio processing
|
| 14 |
+
whisper
|
| 15 |
+
openai-whisper
|
| 16 |
+
faster-whisper
|
| 17 |
+
soundfile
|
| 18 |
+
librosa
|
| 19 |
+
scipy
|
| 20 |
+
webrtcvad-wheels
|
| 21 |
+
|
| 22 |
+
# TTS engines
|
| 23 |
+
gtts
|
| 24 |
+
edge-tts
|
| 25 |
+
pyttsx3
|
| 26 |
+
|
| 27 |
+
# Web server
|
| 28 |
+
gradio==5.3.0
|
| 29 |
+
gradio_client==1.4.2
|
| 30 |
+
fastapi
|
| 31 |
+
uvicorn[standard]
|
| 32 |
+
websockets
|
| 33 |
+
httpx
|
| 34 |
+
|
| 35 |
+
# Utilities
|
| 36 |
+
numpy==1.26.4
|
| 37 |
+
scikit-learn==1.2.2
|
| 38 |
+
pydantic==2.7.0
|
| 39 |
+
markdown2[all]==2.5.2
|
| 40 |
+
shortuuid==1.0.13
|
| 41 |
+
einops
|
| 42 |
+
onnxscript
|
| 43 |
+
omegaconf
|
| 44 |
+
pypinyin>=0.44.0
|
| 45 |
+
pytorch-lightning
|
| 46 |
+
setuptools>=69.5.1
|
| 47 |
+
conformer==0.3.2
|
| 48 |
+
diffusers==0.30.3
|
| 49 |
+
grpcio==1.67.0
|
| 50 |
+
hydra-core==1.3.2
|
| 51 |
+
hyperpyyaml
|
| 52 |
+
inflect==7.0.0
|
| 53 |
+
librosa==0.10.2
|
| 54 |
+
matplotlib
|
| 55 |
+
matcha-tts
|
| 56 |
+
ModelScope
|
| 57 |
+
networkx
|
| 58 |
+
onnx==1.17.0
|
| 59 |
+
onnxruntime-gpu==1.20.0
|
| 60 |
+
pydub
|
| 61 |
+
rich
|
| 62 |
+
rotary-embedding-torch
|
| 63 |
+
sounddevice
|
| 64 |
+
tensorboard
|
| 65 |
+
tiktoken==0.8.0
|
| 66 |
+
tqdm
|
| 67 |
+
WeTextProcessing
|