Spaces:
Runtime error
Runtime error
Update cli.py
Browse files- t5s/cli.py +26 -10
t5s/cli.py
CHANGED
@@ -23,10 +23,13 @@ parser_start.add_argument(
|
|
23 |
"-d",
|
24 |
"--dataset",
|
25 |
default="cnn_dailymail",
|
26 |
-
help="Enter the name of the dataset to be used",
|
|
|
27 |
)
|
28 |
|
29 |
-
parser_start.add_argument(
|
|
|
|
|
30 |
|
31 |
parser_start.add_argument(
|
32 |
"-n", "--name", default="summarsiation", help="Enter the name of the model"
|
@@ -39,13 +42,17 @@ parser_start.add_argument(
|
|
39 |
"--model_name",
|
40 |
default="t5-base",
|
41 |
help="Enter the model to be used eg t5-base",
|
42 |
-
type=str
|
43 |
)
|
44 |
parser_start.add_argument(
|
45 |
"-e", "--epochs", default=5, help="Enter the number of epochs", type=int
|
46 |
)
|
47 |
parser_start.add_argument(
|
48 |
-
"-lr",
|
|
|
|
|
|
|
|
|
49 |
)
|
50 |
parser_start.add_argument(
|
51 |
"-b", "--batch-size", default=2, help="Enter the number of batches", type=int
|
@@ -67,7 +74,7 @@ parser_pull = command_subparser.add_parser(
|
|
67 |
parser_run = command_subparser.add_parser(
|
68 |
"run",
|
69 |
help="run the DVC pipeline - recompute any modified outputs such as "
|
70 |
-
|
71 |
)
|
72 |
|
73 |
parser_visualize = command_subparser.add_parser(
|
@@ -83,6 +90,13 @@ parser_lint = command_subparser.add_parser("lint", help=" Lint using flake8")
|
|
83 |
parser_clone = command_subparser.add_parser(
|
84 |
"clone", help="Clone the T5 summarisation repo"
|
85 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
|
88 |
class Run(object):
|
@@ -104,8 +118,9 @@ class Run(object):
|
|
104 |
"lint",
|
105 |
]
|
106 |
if arguments["command"] == "clone":
|
|
|
107 |
list_files = subprocess.run(
|
108 |
-
["git", "clone", "https://dagshub.com/
|
109 |
)
|
110 |
os.chdir("./summarization/")
|
111 |
retval = os.getcwd()
|
@@ -113,11 +128,11 @@ class Run(object):
|
|
113 |
return list_files.returncode
|
114 |
elif arguments["command"] == "start":
|
115 |
os.chdir("./summarization/")
|
116 |
-
print(
|
|
|
117 |
usage: t5s start [-h] [-d DATASET] [-s SPLIT] [-n NAME] [-mt MODEL_TYPE]
|
118 |
[-m MODEL_NAME] [-e EPOCHS] [-lr LEARNING_RATE]
|
119 |
-
[-b BATCH_SIZE]
|
120 |
-
|
121 |
-h, --help show this help message and exit
|
122 |
-d DATASET, --dataset DATASET
|
123 |
Enter the name of the dataset to be used
|
@@ -134,7 +149,8 @@ usage: t5s start [-h] [-d DATASET] [-s SPLIT] [-n NAME] [-mt MODEL_TYPE]
|
|
134 |
Enter the number of epochs
|
135 |
-b BATCH_SIZE, --batch-size BATCH_SIZE
|
136 |
Enter the number of batches
|
137 |
-
"""
|
|
|
138 |
start(arguments=arguments)
|
139 |
elif arguments["command"] in cmd:
|
140 |
os.chdir("./summarization/")
|
|
|
23 |
"-d",
|
24 |
"--dataset",
|
25 |
default="cnn_dailymail",
|
26 |
+
help="Enter the name of the dataset to be used",
|
27 |
+
type=str,
|
28 |
)
|
29 |
|
30 |
+
parser_start.add_argument(
|
31 |
+
"-s", "--split", default=0.001, help="Enter the split required", type=float
|
32 |
+
)
|
33 |
|
34 |
parser_start.add_argument(
|
35 |
"-n", "--name", default="summarsiation", help="Enter the name of the model"
|
|
|
42 |
"--model_name",
|
43 |
default="t5-base",
|
44 |
help="Enter the model to be used eg t5-base",
|
45 |
+
type=str,
|
46 |
)
|
47 |
parser_start.add_argument(
|
48 |
"-e", "--epochs", default=5, help="Enter the number of epochs", type=int
|
49 |
)
|
50 |
parser_start.add_argument(
|
51 |
+
"-lr",
|
52 |
+
"--learning-rate",
|
53 |
+
default=0.0001,
|
54 |
+
help="Enter the number of epochs",
|
55 |
+
type=float,
|
56 |
)
|
57 |
parser_start.add_argument(
|
58 |
"-b", "--batch-size", default=2, help="Enter the number of batches", type=int
|
|
|
74 |
parser_run = command_subparser.add_parser(
|
75 |
"run",
|
76 |
help="run the DVC pipeline - recompute any modified outputs such as "
|
77 |
+
"processed data or trained models",
|
78 |
)
|
79 |
|
80 |
parser_visualize = command_subparser.add_parser(
|
|
|
90 |
parser_clone = command_subparser.add_parser(
|
91 |
"clone", help="Clone the T5 summarisation repo"
|
92 |
)
|
93 |
+
parser_clone.add_argument(
|
94 |
+
"-u",
|
95 |
+
"--username",
|
96 |
+
help="Enter the your DAGsHub username that you have forked the main repo with",
|
97 |
+
default="gagan3012",
|
98 |
+
type=str,
|
99 |
+
)
|
100 |
|
101 |
|
102 |
class Run(object):
|
|
|
118 |
"lint",
|
119 |
]
|
120 |
if arguments["command"] == "clone":
|
121 |
+
username = arguments["username"]
|
122 |
list_files = subprocess.run(
|
123 |
+
["git", "clone", f"https://dagshub.com/{username}/summarization.git"]
|
124 |
)
|
125 |
os.chdir("./summarization/")
|
126 |
retval = os.getcwd()
|
|
|
128 |
return list_files.returncode
|
129 |
elif arguments["command"] == "start":
|
130 |
os.chdir("./summarization/")
|
131 |
+
print(
|
132 |
+
"""
|
133 |
usage: t5s start [-h] [-d DATASET] [-s SPLIT] [-n NAME] [-mt MODEL_TYPE]
|
134 |
[-m MODEL_NAME] [-e EPOCHS] [-lr LEARNING_RATE]
|
135 |
+
[-b BATCH_SIZE]
|
|
|
136 |
-h, --help show this help message and exit
|
137 |
-d DATASET, --dataset DATASET
|
138 |
Enter the name of the dataset to be used
|
|
|
149 |
Enter the number of epochs
|
150 |
-b BATCH_SIZE, --batch-size BATCH_SIZE
|
151 |
Enter the number of batches
|
152 |
+
"""
|
153 |
+
)
|
154 |
start(arguments=arguments)
|
155 |
elif arguments["command"] in cmd:
|
156 |
os.chdir("./summarization/")
|