File size: 1,179 Bytes
82ce89a
58e9a2a
 
 
 
 
 
 
 
 
 
9ebacb1
 
 
 
 
 
 
 
 
 
 
3b520e7
 
 
 
 
 
 
 
 
 
 
 
 
9ebacb1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
title: Qwen2.5 1.5B Instruct Gkd Demo  
emoji: πŸ“Š  
colorFrom: yellow  
colorTo: red  
sdk: gradio  
sdk_version: 5.34.2  
app_file: app.py  
pinned: false  
license: mit  
short_description: Qwen2.5-1.5B-Instruct-gkd-demo  
---

# Qwen2.5 1.5B Instruct Gkd Demo

A voice-enabled chatbot powered by:
- `Qwen2.5-1.5B-Instruct-gkd` for language generation
- `SpeechT5` for text-to-speech
- `Whisper-small` for speech-to-text

Try chatting, listen to the audio response, or upload an audio file for transcription.

---

## βœ… What’s Fixed & Improved

| Issue | Fix / Enhancement |
|------|---------------------|
| πŸ” **Duplicate TTS Block** | Removed duplicate code in `generate_response_and_audio` |
| ❌ **Incorrect Condition Check** | Replaced unsafe `all([...])` with proper `is not None` checks |
| πŸ“ **Long Text Handling (TTS)** | Added chunking to avoid exceeding 512 token limit |
| 🧠 **LLM Generation Safety** | Ensures `generated_text` is always defined |
| βš™οΈ **Model Loading Optimization** | Moved model loading into the first request (Hugging Face Spaces friendly) |
| 🧼 **Code Cleanliness** | Better structure, comments, and readability |

---