crylake
commited on
Commit
•
bd42647
1
Parent(s):
7d8e7ad
first
Browse files- pipeline.py +3 -3
pipeline.py
CHANGED
@@ -7,7 +7,7 @@ custokenizer = AutoTokenizer.from_pretrained("./GPT2/phoBert", use_fast=False)
|
|
7 |
# -------Load model saved-----------------#
|
8 |
|
9 |
parser = parser_args()
|
10 |
-
parser.add_argument('--img_path', help='img path', default='./test_imgs/test.jpg')
|
11 |
parser.add_argument('--config', help='config file', default='./query2labels/output/config.json')
|
12 |
parser.add_argument('-f')
|
13 |
args = parser.parse_args()
|
@@ -24,8 +24,8 @@ poem = pipeline('text-generation', model="./GPT2/rkw_4sen",
|
|
24 |
config=config)
|
25 |
|
26 |
|
27 |
-
def main():
|
28 |
-
clses = vis_extractor.predict(
|
29 |
|
30 |
keywords = clses
|
31 |
print(keywords)
|
|
|
7 |
# -------Load model saved-----------------#
|
8 |
|
9 |
parser = parser_args()
|
10 |
+
#parser.add_argument('--img_path', help='img path', default='./test_imgs/test.jpg')
|
11 |
parser.add_argument('--config', help='config file', default='./query2labels/output/config.json')
|
12 |
parser.add_argument('-f')
|
13 |
args = parser.parse_args()
|
|
|
24 |
config=config)
|
25 |
|
26 |
|
27 |
+
def main(img_path):
|
28 |
+
clses = vis_extractor.predict(img_path)
|
29 |
|
30 |
keywords = clses
|
31 |
print(keywords)
|