Show download size when model length is unavailable
Build and publish frontend / publish (push) Successful in 49s
Build and publish frontend / publish (push) Successful in 49s
This commit is contained in:
+7
-1
@@ -170,7 +170,8 @@
|
||||
const value = document.querySelector('#speech-progress-value');
|
||||
const preparing = message.startsWith('Förbereder svensk uppläsning.');
|
||||
const match = message.match(/^Hämtar svensk röstmodell till enheten: (\d+) procent\.$/);
|
||||
if (!preparing && !match) {
|
||||
const bytesMatch = message.match(/^Hämtar svensk röstmodell till enheten: ([\d.,]+) MB hämtade\.$/);
|
||||
if (!preparing && !match && !bytesMatch) {
|
||||
container.hidden = true;
|
||||
progress.removeAttribute('value');
|
||||
value.textContent = 'Väntar på nedladdning';
|
||||
@@ -183,6 +184,11 @@
|
||||
value.textContent = `${percent}%`;
|
||||
return true;
|
||||
}
|
||||
if (bytesMatch) {
|
||||
progress.removeAttribute('value');
|
||||
value.textContent = `${bytesMatch[1]} MB hämtade`;
|
||||
return true;
|
||||
}
|
||||
progress.removeAttribute('value');
|
||||
value.textContent = 'Förbereder…';
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user