Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
import onnxruntime as rt
|
3 |
from transformers import AutoTokenizer
|
4 |
import torch, json
|
@@ -21,6 +21,7 @@ def classify_movie_genre(description):
|
|
21 |
probs = torch.sigmoid(logits)[0]
|
22 |
return dict(zip(genres, map(float, probs)))
|
23 |
|
24 |
-
label =
|
25 |
-
iface =
|
26 |
-
iface.launch(inline=False)
|
|
|
|
1 |
+
from gradio import components as grc
|
2 |
import onnxruntime as rt
|
3 |
from transformers import AutoTokenizer
|
4 |
import torch, json
|
|
|
21 |
probs = torch.sigmoid(logits)[0]
|
22 |
return dict(zip(genres, map(float, probs)))
|
23 |
|
24 |
+
label = grc.Label(num_top_classes=5)
|
25 |
+
iface = grc.Interface(fn=classify_movie_genre, inputs="text", outputs=label)
|
26 |
+
iface.launch(inline=False)
|
27 |
+
|