TroglodyteDerivations
commited on
Commit
•
42b7a36
1
Parent(s):
9abbf3b
Updated lines 69 and 81
Browse files
app.py
CHANGED
@@ -15,6 +15,8 @@ st.write(torchaudio.__version__)
|
|
15 |
device = 'cpu'
|
16 |
st.write(device)
|
17 |
|
|
|
|
|
18 |
# Part B: Load the audio file
|
19 |
SPEECH_FILE = 'abby_cadabby.wav'
|
20 |
waveform, sample_rate = torchaudio.load(SPEECH_FILE)
|
@@ -64,7 +66,7 @@ def remove_punctuation(input_string):
|
|
64 |
words = input_string.split()
|
65 |
|
66 |
# Remove punctuation from each word, convert to uppercase, and join them with '|'
|
67 |
-
clean_words = [
|
68 |
clean_transcript = ''.join(clean_words).strip('|')
|
69 |
|
70 |
return clean_transcript
|
@@ -76,7 +78,7 @@ clean_transcript = remove_punctuation(transcript)
|
|
76 |
st.write(clean_transcript)
|
77 |
|
78 |
# Part F: Populate Trellis
|
79 |
-
updated_clean_UPPERCASE_transcript = "OH
|
80 |
dictionary = {c: i for i, c in enumerate(labels)}
|
81 |
|
82 |
tokens = [dictionary[c] for c in updated_clean_UPPERCASE_transcript]
|
|
|
15 |
device = 'cpu'
|
16 |
st.write(device)
|
17 |
|
18 |
+
st.set_option('deprecation.showPyplotGlobalUse', False)
|
19 |
+
|
20 |
# Part B: Load the audio file
|
21 |
SPEECH_FILE = 'abby_cadabby.wav'
|
22 |
waveform, sample_rate = torchaudio.load(SPEECH_FILE)
|
|
|
66 |
words = input_string.split()
|
67 |
|
68 |
# Remove punctuation from each word, convert to uppercase, and join them with '|'
|
69 |
+
clean_words = [word.translate(translator).upper() + '|' for word in words]
|
70 |
clean_transcript = ''.join(clean_words).strip('|')
|
71 |
|
72 |
return clean_transcript
|
|
|
78 |
st.write(clean_transcript)
|
79 |
|
80 |
# Part F: Populate Trellis
|
81 |
+
updated_clean_UPPERCASE_transcript = "OH|HI|ITS|ME|ABBY|CADABBY|DO|YOU|WANT|TO|WATCH|ME|PRACTICE|MY|MAGIC|I|AM|GOING|TO|TURN|THIS"
|
82 |
dictionary = {c: i for i, c in enumerate(labels)}
|
83 |
|
84 |
tokens = [dictionary[c] for c in updated_clean_UPPERCASE_transcript]
|