Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import argparse
|
|
7 |
from libra.eval import libra_eval
|
8 |
from libra.eval.run_libra import load_model
|
9 |
|
10 |
-
|
11 |
"X-iZhang/libra-Llama-3.2-3B-Instruct"]
|
12 |
|
13 |
def get_model_short_name(model_path: str) -> str:
|
@@ -89,7 +89,8 @@ def main():
|
|
89 |
parser.add_argument(
|
90 |
"--model-path",
|
91 |
type=str,
|
92 |
-
|
|
|
93 |
help="User-specified model path. If not provided, only default model is shown."
|
94 |
)
|
95 |
args = parser.parse_args()
|
@@ -97,13 +98,15 @@ def main():
|
|
97 |
|
98 |
|
99 |
model_paths_dict = {}
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
|
108 |
|
109 |
|
|
|
7 |
from libra.eval import libra_eval
|
8 |
from libra.eval.run_libra import load_model
|
9 |
|
10 |
+
DEFAULT_MODEL_PATHS = ["X-iZhang/libra-v1.0-7b",
|
11 |
"X-iZhang/libra-Llama-3.2-3B-Instruct"]
|
12 |
|
13 |
def get_model_short_name(model_path: str) -> str:
|
|
|
89 |
parser.add_argument(
|
90 |
"--model-path",
|
91 |
type=str,
|
92 |
+
nargs="+",
|
93 |
+
default=DEFAULT_MODEL_PATHS,
|
94 |
help="User-specified model path. If not provided, only default model is shown."
|
95 |
)
|
96 |
args = parser.parse_args()
|
|
|
98 |
|
99 |
|
100 |
model_paths_dict = {}
|
101 |
+
|
102 |
+
for model_path in DEFAULT_MODEL_PATHS:
|
103 |
+
model_key = get_model_short_name(model_path)
|
104 |
+
model_paths_dict[model_key] = model_path
|
105 |
+
|
106 |
+
for model_path in cmd_model_paths:
|
107 |
+
user_key = get_model_short_name(model_path)
|
108 |
+
if model_path not in DEFAULT_MODEL_PATHS: # 避免重复
|
109 |
+
model_paths_dict[user_key] = model_path
|
110 |
|
111 |
|
112 |
|