Spaces:
Paused
Paused
Commit
·
be38dd6
1
Parent(s):
12d52ec
Updates
Browse files- app.py +4 -4
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -41,11 +41,11 @@ class ChatBot:
|
|
| 41 |
self.bot_input_ids = None
|
| 42 |
self.device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 43 |
self.tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0", use_fast=False)
|
| 44 |
-
self.model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0"
|
| 45 |
-
self.model = quantize_dynamic(self.model, {torch.nn.Linear}, dtype=torch.qint8)
|
| 46 |
# Parler-TTS Setup
|
| 47 |
-
self.tts_model = ParlerTTSForConditionalGeneration.from_pretrained("doublesizebed/parler-tts-mini-malay")
|
| 48 |
-
self.tts_model = quantize_dynamic(self.tts_model, {torch.nn.Linear}, dtype=torch.qint8)
|
| 49 |
self.tts_tokenizer = AutoTokenizer.from_pretrained("doublesizebed/parler-tts-mini-malay")
|
| 50 |
self.description_tokenizer = AutoTokenizer.from_pretrained(self.tts_model.config.text_encoder._name_or_path)
|
| 51 |
|
|
|
|
| 41 |
self.bot_input_ids = None
|
| 42 |
self.device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 43 |
self.tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0", use_fast=False)
|
| 44 |
+
self.model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
|
| 45 |
+
self.model = torch.ao.quantization.quantize_dynamic(self.model, {torch.nn.Linear}, dtype=torch.qint8)
|
| 46 |
# Parler-TTS Setup
|
| 47 |
+
self.tts_model = ParlerTTSForConditionalGeneration.from_pretrained("doublesizebed/parler-tts-mini-malay")
|
| 48 |
+
self.tts_model = torch.ao.quantization.quantize_dynamic(self.tts_model, {torch.nn.Linear}, dtype=torch.qint8)
|
| 49 |
self.tts_tokenizer = AutoTokenizer.from_pretrained("doublesizebed/parler-tts-mini-malay")
|
| 50 |
self.description_tokenizer = AutoTokenizer.from_pretrained(self.tts_model.config.text_encoder._name_or_path)
|
| 51 |
|
requirements.txt
CHANGED
|
@@ -12,6 +12,6 @@ textblob
|
|
| 12 |
malaya
|
| 13 |
parler_tts
|
| 14 |
nltk
|
| 15 |
-
bitsandbytes
|
| 16 |
accelerate
|
| 17 |
accelerate[torch]
|
|
|
|
| 12 |
malaya
|
| 13 |
parler_tts
|
| 14 |
nltk
|
| 15 |
+
bitsandbytes==0.45.5
|
| 16 |
accelerate
|
| 17 |
accelerate[torch]
|