Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -76,15 +76,23 @@ def classify(video_file,encoded_video):
|
|
76 |
logits = inf_session.run([output_name],{input_name : [input_ids]})[0]
|
77 |
logits = torch.FloatTensor(logits)
|
78 |
probs = torch.sigmoid(logits)[0]
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
text1 = gr.Textbox(label="Text")
|
82 |
text2 = gr.Textbox(label="Summary")
|
83 |
|
|
|
|
|
84 |
|
85 |
iface = gr.Interface(fn=classify,
|
86 |
inputs=['video','text'],
|
87 |
-
outputs = [text1,text2,gr.outputs.Label(num_top_classes=3)])
|
88 |
iface.launch(inline=False)
|
89 |
|
90 |
|
|
|
76 |
logits = inf_session.run([output_name],{input_name : [input_ids]})[0]
|
77 |
logits = torch.FloatTensor(logits)
|
78 |
probs = torch.sigmoid(logits)[0]
|
79 |
+
|
80 |
+
final = {
|
81 |
+
'text':full_text,
|
82 |
+
'summary':sum,
|
83 |
+
'label':dict(zip(classes,map(float,probs)))
|
84 |
+
}
|
85 |
+
return full_text, sum, dict(zip(classes,map(float,probs))), final
|
86 |
|
87 |
text1 = gr.Textbox(label="Text")
|
88 |
text2 = gr.Textbox(label="Summary")
|
89 |
|
90 |
+
|
91 |
+
|
92 |
|
93 |
iface = gr.Interface(fn=classify,
|
94 |
inputs=['video','text'],
|
95 |
+
outputs = [text1,text2,gr.outputs.Label(num_top_classes=3),final])
|
96 |
iface.launch(inline=False)
|
97 |
|
98 |
|