Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,12 +40,12 @@ def inference(raw_image, input_tag):
|
|
40 |
with torch.no_grad():
|
41 |
|
42 |
|
43 |
-
caption, tag_predict = model.generate(image,tag_input = input_tag_list, return_tag_predict = True)
|
44 |
if input_tag_list == None:
|
45 |
tag_1 = tag_predict
|
46 |
tag_2 = ['none']
|
47 |
else:
|
48 |
-
_, tag_1 = model.generate(image,tag_input = None, return_tag_predict = True)
|
49 |
tag_2 = tag_predict
|
50 |
|
51 |
return tag_1[0],tag_2[0],caption[0]
|
|
|
40 |
with torch.no_grad():
|
41 |
|
42 |
|
43 |
+
caption, tag_predict = model.generate(image,tag_input = input_tag_list,max_length = 50, return_tag_predict = True)
|
44 |
if input_tag_list == None:
|
45 |
tag_1 = tag_predict
|
46 |
tag_2 = ['none']
|
47 |
else:
|
48 |
+
_, tag_1 = model.generate(image,tag_input = None, max_length = 50, return_tag_predict = True)
|
49 |
tag_2 = tag_predict
|
50 |
|
51 |
return tag_1[0],tag_2[0],caption[0]
|