Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1204,9 +1204,109 @@ class YouTube:
|
|
1204 |
self.log(error(error_msg))
|
1205 |
raise Exception(error_msg)
|
1206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1208 |
|
1209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1210 |
|
1211 |
# Create the Gradio interface
|
1212 |
def create_interface():
|
|
|
1204 |
self.log(error(error_msg))
|
1205 |
raise Exception(error_msg)
|
1206 |
|
1207 |
+
# Data for dynamic dropdowns
|
1208 |
+
def get_text_generator_models(generator):
|
1209 |
+
"""Get available models for the selected text generator."""
|
1210 |
+
models = {
|
1211 |
+
"gemini": [
|
1212 |
+
"gemini-2.0-flash",
|
1213 |
+
"gemini-2.0-flash-lite",
|
1214 |
+
"gemini-1.5-flash",
|
1215 |
+
"gemini-1.5-flash-8b",
|
1216 |
+
"gemini-1.5-pro"
|
1217 |
+
],
|
1218 |
+
"g4f": [
|
1219 |
+
"gpt-4",
|
1220 |
+
"gpt-4o",
|
1221 |
+
"gpt-3.5-turbo",
|
1222 |
+
"llama-3-70b-chat",
|
1223 |
+
"claude-3-opus-20240229",
|
1224 |
+
"claude-3-sonnet-20240229",
|
1225 |
+
"claude-3-haiku-20240307"
|
1226 |
+
],
|
1227 |
+
"openai": [
|
1228 |
+
"gpt-4o",
|
1229 |
+
"gpt-4-turbo",
|
1230 |
+
"gpt-3.5-turbo"
|
1231 |
+
]
|
1232 |
+
}
|
1233 |
+
return models.get(generator, ["default"])
|
1234 |
|
1235 |
+
def get_image_generator_models(generator):
|
1236 |
+
"""Get available models for the selected image generator."""
|
1237 |
+
models = {
|
1238 |
+
"prodia": [
|
1239 |
+
"sdxl",
|
1240 |
+
"realvisxl",
|
1241 |
+
"juggernaut",
|
1242 |
+
"dreamshaper",
|
1243 |
+
"dalle"
|
1244 |
+
],
|
1245 |
+
"hercai": [
|
1246 |
+
"v1",
|
1247 |
+
"v2",
|
1248 |
+
"v3",
|
1249 |
+
"lexica"
|
1250 |
+
],
|
1251 |
+
"g4f": [
|
1252 |
+
"flux",
|
1253 |
+
"dall-e-3",
|
1254 |
+
"dall-e-2",
|
1255 |
+
"midjourney"
|
1256 |
+
],
|
1257 |
+
"segmind": [
|
1258 |
+
"sdxl-turbo",
|
1259 |
+
"realistic-vision",
|
1260 |
+
"sd3"
|
1261 |
+
],
|
1262 |
+
"pollinations": [
|
1263 |
+
"default"
|
1264 |
+
]
|
1265 |
+
}
|
1266 |
+
return models.get(generator, ["default"])
|
1267 |
|
1268 |
+
def get_tts_voices(engine):
|
1269 |
+
"""Get available voices for the selected TTS engine."""
|
1270 |
+
voices = {
|
1271 |
+
"elevenlabs": [
|
1272 |
+
"Sarah",
|
1273 |
+
"Brian",
|
1274 |
+
"Lily",
|
1275 |
+
"Monika Sogam",
|
1276 |
+
"George",
|
1277 |
+
"River",
|
1278 |
+
"Matilda",
|
1279 |
+
"Will",
|
1280 |
+
"Jessica"
|
1281 |
+
],
|
1282 |
+
"openai": [
|
1283 |
+
"alloy",
|
1284 |
+
"echo",
|
1285 |
+
"fable",
|
1286 |
+
"onyx",
|
1287 |
+
"nova",
|
1288 |
+
"shimmer"
|
1289 |
+
],
|
1290 |
+
"edge": [
|
1291 |
+
"en-US-AriaNeural",
|
1292 |
+
"en-US-GuyNeural",
|
1293 |
+
"en-GB-SoniaNeural",
|
1294 |
+
"en-AU-NatashaNeural"
|
1295 |
+
],
|
1296 |
+
"gtts": [
|
1297 |
+
"en",
|
1298 |
+
"es",
|
1299 |
+
"fr",
|
1300 |
+
"de",
|
1301 |
+
"it",
|
1302 |
+
"pt",
|
1303 |
+
"ru",
|
1304 |
+
"ja",
|
1305 |
+
"zh",
|
1306 |
+
"hi"
|
1307 |
+
]
|
1308 |
+
}
|
1309 |
+
return voices.get(engine, ["default"])
|
1310 |
|
1311 |
# Create the Gradio interface
|
1312 |
def create_interface():
|