victor HF staff commited on
Commit
300b66c
·
1 Parent(s): dba4524

refactor: Update model choice from DeepSeek-V3-Base to DeepSeek-V3 in function and examples

Browse files
Files changed (1) hide show
  1. app.py +24 -13
app.py CHANGED
@@ -154,10 +154,10 @@ YOUR FFMPEG COMMAND:
154
  print(msg["content"])
155
  print("=====================\n")
156
 
157
- if model_choice == "deepseek-ai/DeepSeek-V3-Base":
158
  client.base_url = "https://api.deepseek.com/v1"
159
  client.api_key = DEEPSEEK_API_KEY
160
- model = "deepseek-ai/DeepSeek-V3-Base"
161
  else:
162
  client.base_url = "https://api-inference.huggingface.co/v1/"
163
  client.api_key = HF_API_KEY
@@ -192,7 +192,13 @@ YOUR FFMPEG COMMAND:
192
  raise Exception("API Error")
193
 
194
 
195
- def update(files, prompt, top_p=1, temperature=1, model_choice="Qwen/Qwen2.5-Coder-32B-Instruct"):
 
 
 
 
 
 
196
  if prompt == "":
197
  raise gr.Error("Please enter a prompt.")
198
 
@@ -211,7 +217,9 @@ def update(files, prompt, top_p=1, temperature=1, model_choice="Qwen/Qwen2.5-Cod
211
  while attempts < 2:
212
  print("ATTEMPT", attempts)
213
  try:
214
- command_string = get_completion(prompt, files_info, top_p, temperature, model_choice)
 
 
215
  print(
216
  f"""///PROMTP {prompt} \n\n/// START OF COMMAND ///:\n\n{command_string}\n\n/// END OF COMMAND ///\n\n"""
217
  )
@@ -281,9 +289,12 @@ with gr.Blocks() as demo:
281
  btn = gr.Button("Run")
282
  with gr.Accordion("Parameters", open=False):
283
  model_choice = gr.Radio(
284
- choices=["Qwen/Qwen2.5-Coder-32B-Instruct", "deepseek-ai/DeepSeek-V3-Base"],
285
- value="deepseek-ai/DeepSeek-V3-Base",
286
- label="Model"
 
 
 
287
  )
288
  top_p = gr.Slider(
289
  minimum=-0,
@@ -357,12 +368,12 @@ with gr.Blocks() as demo:
357
  [
358
  "./examples/waterfall.mp4",
359
  "./examples/heat-wave.mp3",
360
- "./examples/square-image.png"
361
  ],
362
  "Create a music video where the waterfall plays in slow motion (0.5x speed) with the heat wave audio track, and the square image appears as a rotating album cover in the bottom right corner",
363
  0.7,
364
  0.1,
365
- "deepseek-ai/DeepSeek-V3-Base",
366
  ],
367
  [
368
  [
@@ -374,23 +385,23 @@ with gr.Blocks() as demo:
374
  "./examples/cat6.jpeg",
375
  "./examples/cat7.jpeg",
376
  "./examples/cat8.jpeg",
377
- "./examples/ai_talk.wav"
378
  ],
379
  "Create a cat montage where each cat image zooms in and out sequentially for 2 seconds each, synchronized with the audio track, and add a vintage film grain effect",
380
  0.7,
381
  0.1,
382
- "deepseek-ai/DeepSeek-V3-Base",
383
  ],
384
  [
385
  [
386
  "./examples/waterfall-overlay.png",
387
  "./examples/bg-image.png",
388
- "./examples/example.mp4"
389
  ],
390
  "Create a picture-in-picture effect with the example video in the bottom right corner, the waterfall overlay as a semi-transparent watermark, and the background image filling the rest of the frame",
391
  0.7,
392
  0.1,
393
- "deepseek-ai/DeepSeek-V3-Base",
394
  ],
395
  ],
396
  inputs=[user_files, user_prompt, top_p, temperature, model_choice],
 
154
  print(msg["content"])
155
  print("=====================\n")
156
 
157
+ if model_choice == "deepseek-ai/DeepSeek-V3":
158
  client.base_url = "https://api.deepseek.com/v1"
159
  client.api_key = DEEPSEEK_API_KEY
160
+ model = "deepseek-ai/DeepSeek-V3"
161
  else:
162
  client.base_url = "https://api-inference.huggingface.co/v1/"
163
  client.api_key = HF_API_KEY
 
192
  raise Exception("API Error")
193
 
194
 
195
+ def update(
196
+ files,
197
+ prompt,
198
+ top_p=1,
199
+ temperature=1,
200
+ model_choice="Qwen/Qwen2.5-Coder-32B-Instruct",
201
+ ):
202
  if prompt == "":
203
  raise gr.Error("Please enter a prompt.")
204
 
 
217
  while attempts < 2:
218
  print("ATTEMPT", attempts)
219
  try:
220
+ command_string = get_completion(
221
+ prompt, files_info, top_p, temperature, model_choice
222
+ )
223
  print(
224
  f"""///PROMTP {prompt} \n\n/// START OF COMMAND ///:\n\n{command_string}\n\n/// END OF COMMAND ///\n\n"""
225
  )
 
289
  btn = gr.Button("Run")
290
  with gr.Accordion("Parameters", open=False):
291
  model_choice = gr.Radio(
292
+ choices=[
293
+ "Qwen/Qwen2.5-Coder-32B-Instruct",
294
+ "deepseek-ai/DeepSeek-V3",
295
+ ],
296
+ value="deepseek-ai/DeepSeek-V3",
297
+ label="Model",
298
  )
299
  top_p = gr.Slider(
300
  minimum=-0,
 
368
  [
369
  "./examples/waterfall.mp4",
370
  "./examples/heat-wave.mp3",
371
+ "./examples/square-image.png",
372
  ],
373
  "Create a music video where the waterfall plays in slow motion (0.5x speed) with the heat wave audio track, and the square image appears as a rotating album cover in the bottom right corner",
374
  0.7,
375
  0.1,
376
+ "deepseek-ai/DeepSeek-V3",
377
  ],
378
  [
379
  [
 
385
  "./examples/cat6.jpeg",
386
  "./examples/cat7.jpeg",
387
  "./examples/cat8.jpeg",
388
+ "./examples/ai_talk.wav",
389
  ],
390
  "Create a cat montage where each cat image zooms in and out sequentially for 2 seconds each, synchronized with the audio track, and add a vintage film grain effect",
391
  0.7,
392
  0.1,
393
+ "deepseek-ai/DeepSeek-V3",
394
  ],
395
  [
396
  [
397
  "./examples/waterfall-overlay.png",
398
  "./examples/bg-image.png",
399
+ "./examples/example.mp4",
400
  ],
401
  "Create a picture-in-picture effect with the example video in the bottom right corner, the waterfall overlay as a semi-transparent watermark, and the background image filling the rest of the frame",
402
  0.7,
403
  0.1,
404
+ "deepseek-ai/DeepSeek-V3",
405
  ],
406
  ],
407
  inputs=[user_files, user_prompt, top_p, temperature, model_choice],