atalaydenknalbant commited on
Commit
1c082c8
·
verified ·
1 Parent(s): c668691

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -2,22 +2,21 @@ import spaces
2
  import supervision as sv
3
  import PIL.Image as Image
4
  from ultralytics import YOLO
5
- from huggingface_hub import hf_hub_download
6
  import gradio as gr
7
  import torch
8
  global repo_id
9
 
10
  repo_id = "atalaydenknalbant/asl-yolo-models"
11
 
 
 
 
 
 
12
 
13
- model_filenames = [
14
- "yolov10s.pt",
15
- "yolov10x.pt",
16
- "yolov8s.pt",
17
- "yolov8x.pt",
18
- "yolov9e.pt",
19
- "yolov9s.pt"
20
- ]
21
 
22
  def download_models(repo_id, model_id):
23
  # Download the selected model
 
2
  import supervision as sv
3
  import PIL.Image as Image
4
  from ultralytics import YOLO
5
+ from huggingface_hub import hf_hub_download, HfApi
6
  import gradio as gr
7
  import torch
8
  global repo_id
9
 
10
  repo_id = "atalaydenknalbant/asl-yolo-models"
11
 
12
+ def get_model_filenames(repo_id):
13
+ api = HfApi()
14
+ files = api.list_repo_files(repo_id)
15
+ model_filenames = [file for file in files if file.endswith('.pt')]
16
+ return model_filenames
17
 
18
+
19
+ model_filenames = get_model_filenames(repo_id)
 
 
 
 
 
 
20
 
21
  def download_models(repo_id, model_id):
22
  # Download the selected model