Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,6 +39,16 @@ data = {
|
|
39 |
}
|
40 |
# Define a dictionary to store model configurations
|
41 |
model_configurations = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
import logging
|
43 |
import math
|
44 |
import sys
|
@@ -63,14 +73,7 @@ async def read_root(request: Request):
|
|
63 |
# Make sure speaker_id_map is defined and populated correctly
|
64 |
# data = {"your_data_key": "your_data_value"} # Replace with your data
|
65 |
# model_configurations = {} # Replace with your model configurations
|
66 |
-
|
67 |
-
|
68 |
-
# Define and populate speaker_id_map
|
69 |
-
speaker_id_map = {
|
70 |
-
"speaker1": "Speaker 1 Name",
|
71 |
-
"speaker2": "Speaker 2 Name",
|
72 |
-
# Add more speaker IDs and names as needed
|
73 |
-
}
|
74 |
|
75 |
# Ensure that speaker_id_map is included in the context
|
76 |
return templates.TemplateResponse("interface.html", {"request": request, "data": data, "model_names": model_configurations.keys(), "speaker_id_map": speaker_id_map})
|
@@ -86,9 +89,6 @@ import sys
|
|
86 |
#sys.path.append('/content/piper/notebooks')
|
87 |
sys.path.append('./content/piper/src/python')
|
88 |
import configparser
|
89 |
-
# Define global variables
|
90 |
-
onnx_models = [] # A list to store model names
|
91 |
-
model_configurations = {} # A dictionary to store model configurations
|
92 |
|
93 |
class Translator:
|
94 |
def __init__(self):
|
|
|
39 |
}
|
40 |
# Define a dictionary to store model configurations
|
41 |
model_configurations = {}
|
42 |
+
# Define global variables
|
43 |
+
onnx_models = [] # A list to store model names
|
44 |
+
|
45 |
+
speaker_id_map = {
|
46 |
+
"speaker1": "Speaker 1 Name",
|
47 |
+
"speaker2": "Speaker 2 Name",
|
48 |
+
# Add more speaker IDs and names as needed
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
import logging
|
53 |
import math
|
54 |
import sys
|
|
|
73 |
# Make sure speaker_id_map is defined and populated correctly
|
74 |
# data = {"your_data_key": "your_data_value"} # Replace with your data
|
75 |
# model_configurations = {} # Replace with your model configurations
|
76 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
# Ensure that speaker_id_map is included in the context
|
79 |
return templates.TemplateResponse("interface.html", {"request": request, "data": data, "model_names": model_configurations.keys(), "speaker_id_map": speaker_id_map})
|
|
|
89 |
#sys.path.append('/content/piper/notebooks')
|
90 |
sys.path.append('./content/piper/src/python')
|
91 |
import configparser
|
|
|
|
|
|
|
92 |
|
93 |
class Translator:
|
94 |
def __init__(self):
|