waddaheaven
commited on
Commit
•
220e363
1
Parent(s):
94f96e7
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import AutoTokenizer
|
|
4 |
import torch
|
5 |
import json
|
6 |
|
7 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
8 |
|
9 |
with open("genre_types_encoded.json", "r") as fp:
|
10 |
encode_genre_types = json.load(fp)
|
@@ -33,6 +33,6 @@ def classify_movie_genre(summary):
|
|
33 |
|
34 |
return dict(zip(genres, map(float, probs)))
|
35 |
|
36 |
-
label = gr.Label(num_top_classes=
|
37 |
iface = gr.Interface(fn=classify_movie_genre, inputs="text", outputs=label)
|
38 |
iface.launch(inline=False)
|
|
|
4 |
import torch
|
5 |
import json
|
6 |
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
|
8 |
|
9 |
with open("genre_types_encoded.json", "r") as fp:
|
10 |
encode_genre_types = json.load(fp)
|
|
|
33 |
|
34 |
return dict(zip(genres, map(float, probs)))
|
35 |
|
36 |
+
label = gr.Label(num_top_classes=5)
|
37 |
iface = gr.Interface(fn=classify_movie_genre, inputs="text", outputs=label)
|
38 |
iface.launch(inline=False)
|