Spaces:
Sleeping
Sleeping
Update Traffic_Signs_Classification.py
Browse files- Traffic_Signs_Classification.py +10 -10
Traffic_Signs_Classification.py
CHANGED
@@ -38,13 +38,13 @@ if uploaded_file is not None:
|
|
38 |
|
39 |
#speech the Traffic Sign
|
40 |
|
41 |
-
model2 = VitsModel.from_pretrained("facebook/mms-tts-eng")
|
42 |
-
tokenizer = AutoTokenizer.from_pretrained("facebook/mms-tts-eng")
|
43 |
-
|
44 |
-
text = text_value
|
45 |
-
inputs = tokenizer(text, return_tensors="pt")
|
46 |
-
|
47 |
-
with torch.no_grad():
|
48 |
-
|
49 |
-
|
50 |
-
Audio(output.numpy(), rate=model2.config.sampling_rate)
|
|
|
38 |
|
39 |
#speech the Traffic Sign
|
40 |
|
41 |
+
model2 = VitsModel.from_pretrained("facebook/mms-tts-eng")
|
42 |
+
tokenizer = AutoTokenizer.from_pretrained("facebook/mms-tts-eng")
|
43 |
+
|
44 |
+
text = text_value
|
45 |
+
inputs = tokenizer(text, return_tensors="pt")
|
46 |
+
|
47 |
+
with torch.no_grad():
|
48 |
+
output = model2(**inputs).waveform
|
49 |
+
|
50 |
+
Audio(output.numpy(), rate=model2.config.sampling_rate)
|