Edmon02 commited on
Commit
f50f82b
โ€ข
1 Parent(s): 942b580

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -2,8 +2,11 @@ import gradio as gr
2
  import librosa
3
  import numpy as np
4
  import torch
 
5
  import string
6
  import httpx
 
 
7
 
8
  from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
9
 
@@ -18,13 +21,6 @@ speaker_embeddings = {
18
  "BDL": "cmu_us_bdl_arctic-wav-arctic_a0009.npy",
19
  }
20
 
21
- import pandas as pd
22
- import inflect
23
- import re
24
- from googletrans import Translator
25
-
26
- translator = Translator()
27
-
28
  def convert_number_to_words(number: float) -> str:
29
  p = inflect.engine()
30
  words = p.number_to_words(number)
@@ -63,15 +59,6 @@ def process_text(text: str) -> str:
63
  processed_text = ' '.join(words)
64
  return processed_text
65
 
66
- # Read CSV file into a pandas DataFrame
67
- df = pd.read_csv('AudioSet.csv')
68
-
69
- # Apply the processing function to the 'normalized_text' column
70
- df['normalized_text'] = df['normalized_text'].apply(process_text)
71
-
72
- # Save the updated DataFrame back to the CSV file
73
- df.to_csv('AudioSet.csv', index=False)
74
-
75
  replacements = [
76
  ("ีš", "?"),
77
  ('ี›', ""),
 
2
  import librosa
3
  import numpy as np
4
  import torch
5
+
6
  import string
7
  import httpx
8
+ import inflect
9
+ import re
10
 
11
  from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
12
 
 
21
  "BDL": "cmu_us_bdl_arctic-wav-arctic_a0009.npy",
22
  }
23
 
 
 
 
 
 
 
 
24
  def convert_number_to_words(number: float) -> str:
25
  p = inflect.engine()
26
  words = p.number_to_words(number)
 
59
  processed_text = ' '.join(words)
60
  return processed_text
61
 
 
 
 
 
 
 
 
 
 
62
  replacements = [
63
  ("ีš", "?"),
64
  ('ี›', ""),