attempt to use token for download
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import argparse
|
|
| 3 |
import gradio as gr
|
| 4 |
import glob
|
| 5 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 6 |
|
| 7 |
def parse_option():
|
| 8 |
parser = argparse.ArgumentParser('MetaFG Inference script', add_help=False)
|
|
@@ -19,17 +20,23 @@ if __name__ == '__main__':
|
|
| 19 |
args = parse_option()
|
| 20 |
|
| 21 |
if not args.model_path:
|
| 22 |
-
model_path = hf_hub_download(repo_id="joshvm/inaturalist_sgd_4k",
|
|
|
|
|
|
|
| 23 |
else:
|
| 24 |
model_path = args.model_path
|
| 25 |
|
| 26 |
if not args.cfg:
|
| 27 |
-
model_config = hf_hub_download(repo_id="joshvm/inaturalist_sgd_4k",
|
|
|
|
|
|
|
| 28 |
else:
|
| 29 |
model_config = args.cfg
|
| 30 |
|
| 31 |
if not args.names_path:
|
| 32 |
-
names_path = hf_hub_download(repo_id="joshvm/inaturalist_sgd_4k",
|
|
|
|
|
|
|
| 33 |
else:
|
| 34 |
names_path = args.names_path
|
| 35 |
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
import glob
|
| 5 |
from huggingface_hub import hf_hub_download
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
def parse_option():
|
| 9 |
parser = argparse.ArgumentParser('MetaFG Inference script', add_help=False)
|
|
|
|
| 20 |
args = parse_option()
|
| 21 |
|
| 22 |
if not args.model_path:
|
| 23 |
+
model_path = hf_hub_download(repo_id="joshvm/inaturalist_sgd_4k",
|
| 24 |
+
filename="ckpt_epoch_35.pth",
|
| 25 |
+
token=os.environ["HUGGINGFACE_TOKEN"])
|
| 26 |
else:
|
| 27 |
model_path = args.model_path
|
| 28 |
|
| 29 |
if not args.cfg:
|
| 30 |
+
model_config = hf_hub_download(repo_id="joshvm/inaturalist_sgd_4k",
|
| 31 |
+
filename="MetaFG_2_224.yaml",
|
| 32 |
+
token=os.environ["HUGGINGFACE_TOKEN"])
|
| 33 |
else:
|
| 34 |
model_config = args.cfg
|
| 35 |
|
| 36 |
if not args.names_path:
|
| 37 |
+
names_path = hf_hub_download(repo_id="joshvm/inaturalist_sgd_4k",
|
| 38 |
+
filename="names_mf2.txt",
|
| 39 |
+
token=os.environ["HUGGINGFACE_TOKEN"])
|
| 40 |
else:
|
| 41 |
names_path = args.names_path
|
| 42 |
|