alexnasa commited on
Commit
9bb7305
·
verified ·
1 Parent(s): 0d7d99e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -0
app.py CHANGED
@@ -371,6 +371,60 @@ def update_inputs(is_open, index, state: list):
371
  print(indexs)
372
  return indexs, is_open
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  with gr.Blocks() as demo:
375
 
376
  indexs_state = gr.State([0, 1]) # 添加状态来存储 indexs
 
371
  print(indexs)
372
  return indexs, is_open
373
 
374
+ from huggingface_hub import snapshot_download
375
+
376
+ # FLUX.1-dev
377
+ snapshot_download(
378
+ repo_id="black-forest-labs/FLUX.1-dev",
379
+ local_dir="./FLUX.1-dev",
380
+ local_dir_use_symlinks=False
381
+ )
382
+
383
+ # Florence-2-large
384
+ snapshot_download(
385
+ repo_id="microsoft/Florence-2-large",
386
+ local_dir="./Florence-2-large",
387
+ local_dir_use_symlinks=False
388
+ )
389
+
390
+ # CLIP ViT Large
391
+ snapshot_download(
392
+ repo_id="openai/clip-vit-large-patch14",
393
+ local_dir="./clip-vit-large-patch14",
394
+ local_dir_use_symlinks=False
395
+ )
396
+
397
+ # DINO ViT-s16
398
+ snapshot_download(
399
+ repo_id="facebook/dino-vits16",
400
+ local_dir="./dino-vits16",
401
+ local_dir_use_symlinks=False
402
+ )
403
+
404
+ # mPLUG Visual Question Answering
405
+ snapshot_download(
406
+ repo_id="xingjianleng/mplug_visual-question-answering_coco_large_en",
407
+ local_dir="./mplug_visual-question-answering_coco_large_en",
408
+ local_dir_use_symlinks=False
409
+ )
410
+
411
+ # XVerse
412
+ snapshot_download(
413
+ repo_id="ByteDance/XVerse",
414
+ local_dir="./XVerse",
415
+ local_dir_use_symlinks=False
416
+ )
417
+
418
+
419
+ os.environ["FLORENCE2_MODEL_PATH"] = "./checkpoints/Florence-2-large"
420
+ os.environ["SAM2_MODEL_PATH"] = "./checkpoints/sam2.1_hiera_large.pt"
421
+ os.environ["FACE_ID_MODEL_PATH"] = "./checkpoints/model_ir_se50.pth"
422
+ os.environ["CLIP_MODEL_PATH"] = "./checkpoints/clip-vit-large-patch14"
423
+ os.environ["FLUX_MODEL_PATH"] = "./checkpoints/FLUX.1-dev"
424
+ os.environ["DPG_VQA_MODEL_PATH"] = "./checkpoints/mplug_visual-question-answering_coco_large_en"
425
+ os.environ["DINO_MODEL_PATH"] = "./checkpoints/dino-vits16"
426
+
427
+
428
  with gr.Blocks() as demo:
429
 
430
  indexs_state = gr.State([0, 1]) # 添加状态来存储 indexs