Spaces:
Running
Running
refactor: Reorder model configuration for improved clarity and update model selection logic
Browse files
app.py
CHANGED
|
@@ -14,14 +14,14 @@ import shutil
|
|
| 14 |
|
| 15 |
# Supported models configuration
|
| 16 |
MODELS = {
|
| 17 |
-
"Qwen/Qwen2.5-Coder-32B-Instruct": {
|
| 18 |
-
"base_url": "https://api-inference.huggingface.co/v1/",
|
| 19 |
-
"env_key": "HF_TOKEN",
|
| 20 |
-
},
|
| 21 |
"deepseek-ai/DeepSeek-V3": {
|
| 22 |
"base_url": "https://api.deepseek.com/v1",
|
| 23 |
"env_key": "DEEPSEEK_API_KEY",
|
| 24 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
# Initialize client with first available model
|
|
@@ -340,18 +340,18 @@ with gr.Blocks() as demo:
|
|
| 340 |
"Use the image as the background with a waveform visualization for the audio positioned in center of the video.",
|
| 341 |
0.7,
|
| 342 |
0.1,
|
| 343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
],
|
| 345 |
[
|
| 346 |
["./examples/ai_talk.wav", "./examples/bg-image.png"],
|
| 347 |
"Use the image as the background with a waveform visualization for the audio positioned in center of the video. Make sure the waveform has a max height of 250 pixels.",
|
| 348 |
0.7,
|
| 349 |
0.1,
|
| 350 |
-
(
|
| 351 |
-
list(MODELS.keys())[1]
|
| 352 |
-
if len(MODELS) > 1
|
| 353 |
-
else list(MODELS.keys())[0]
|
| 354 |
-
),
|
| 355 |
],
|
| 356 |
[
|
| 357 |
[
|
|
@@ -366,7 +366,11 @@ with gr.Blocks() as demo:
|
|
| 366 |
"Create a 3x2 grid of the cat images with the audio as background music. Make the video duration match the audio duration.",
|
| 367 |
0.7,
|
| 368 |
0.1,
|
| 369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
],
|
| 371 |
],
|
| 372 |
inputs=[user_files, user_prompt, top_p, temperature, model_choice],
|
|
|
|
| 14 |
|
| 15 |
# Supported models configuration
|
| 16 |
MODELS = {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"deepseek-ai/DeepSeek-V3": {
|
| 18 |
"base_url": "https://api.deepseek.com/v1",
|
| 19 |
"env_key": "DEEPSEEK_API_KEY",
|
| 20 |
},
|
| 21 |
+
"Qwen/Qwen2.5-Coder-32B-Instruct": {
|
| 22 |
+
"base_url": "https://api-inference.huggingface.co/v1/",
|
| 23 |
+
"env_key": "HF_TOKEN",
|
| 24 |
+
},
|
| 25 |
}
|
| 26 |
|
| 27 |
# Initialize client with first available model
|
|
|
|
| 340 |
"Use the image as the background with a waveform visualization for the audio positioned in center of the video.",
|
| 341 |
0.7,
|
| 342 |
0.1,
|
| 343 |
+
(
|
| 344 |
+
list(MODELS.keys())[1]
|
| 345 |
+
if len(MODELS) > 1
|
| 346 |
+
else list(MODELS.keys())[0]
|
| 347 |
+
),
|
| 348 |
],
|
| 349 |
[
|
| 350 |
["./examples/ai_talk.wav", "./examples/bg-image.png"],
|
| 351 |
"Use the image as the background with a waveform visualization for the audio positioned in center of the video. Make sure the waveform has a max height of 250 pixels.",
|
| 352 |
0.7,
|
| 353 |
0.1,
|
| 354 |
+
list(MODELS.keys())[0],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
],
|
| 356 |
[
|
| 357 |
[
|
|
|
|
| 366 |
"Create a 3x2 grid of the cat images with the audio as background music. Make the video duration match the audio duration.",
|
| 367 |
0.7,
|
| 368 |
0.1,
|
| 369 |
+
(
|
| 370 |
+
list(MODELS.keys())[1]
|
| 371 |
+
if len(MODELS) > 1
|
| 372 |
+
else list(MODELS.keys())[0]
|
| 373 |
+
),
|
| 374 |
],
|
| 375 |
],
|
| 376 |
inputs=[user_files, user_prompt, top_p, temperature, model_choice],
|