Spaces:
Runtime error
Runtime error
dkoshman
commited on
Commit
•
668a83d
1
Parent(s):
645bb1b
fixed bug where model item ids didn't match up with tmdb movie ids
Browse files
app.py
CHANGED
@@ -4,26 +4,25 @@ import gradio as gr
|
|
4 |
import wandb
|
5 |
|
6 |
from machine_learning.recommending.app import (
|
7 |
-
MovieLens25m,
|
8 |
build_app_blocks,
|
|
|
|
|
9 |
MovieMarkdownGenerator,
|
10 |
SVDRecommender,
|
11 |
-
load_model,
|
12 |
)
|
13 |
|
14 |
project = "Recommending"
|
15 |
entity = "dkoshman"
|
|
|
16 |
state_dict_path = "svd.pt"
|
17 |
movie_lens_25m_directory = "ml-25m"
|
18 |
tmdb_api_token = os.environ["TMDB_API_TOKEN"]
|
19 |
|
20 |
movielens = MovieLens25m(path_to_movielens_folder=movie_lens_25m_directory)
|
21 |
movie_markdown_generator = MovieMarkdownGenerator(
|
22 |
-
|
23 |
-
movies_dataframe=movielens["movies"],
|
24 |
-
tmdb_api_token=tmdb_api_token,
|
25 |
)
|
26 |
-
model = load_model(torch_nn_module=
|
27 |
model.eval()
|
28 |
|
29 |
with gr.Blocks() as app:
|
@@ -32,6 +31,13 @@ with gr.Blocks() as app:
|
|
32 |
movie_markdown_generator=movie_markdown_generator,
|
33 |
)
|
34 |
|
35 |
-
wandb.
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
app.launch()
|
|
|
4 |
import wandb
|
5 |
|
6 |
from machine_learning.recommending.app import (
|
|
|
7 |
build_app_blocks,
|
8 |
+
load_model,
|
9 |
+
MovieLens25m,
|
10 |
MovieMarkdownGenerator,
|
11 |
SVDRecommender,
|
|
|
12 |
)
|
13 |
|
14 |
project = "Recommending"
|
15 |
entity = "dkoshman"
|
16 |
+
torch_nn_module = SVDRecommender
|
17 |
state_dict_path = "svd.pt"
|
18 |
movie_lens_25m_directory = "ml-25m"
|
19 |
tmdb_api_token = os.environ["TMDB_API_TOKEN"]
|
20 |
|
21 |
movielens = MovieLens25m(path_to_movielens_folder=movie_lens_25m_directory)
|
22 |
movie_markdown_generator = MovieMarkdownGenerator(
|
23 |
+
movielens=movielens, tmdb_api_token=tmdb_api_token
|
|
|
|
|
24 |
)
|
25 |
+
model = load_model(torch_nn_module=torch_nn_module, state_dict_path=state_dict_path)
|
26 |
model.eval()
|
27 |
|
28 |
with gr.Blocks() as app:
|
|
|
31 |
movie_markdown_generator=movie_markdown_generator,
|
32 |
)
|
33 |
|
34 |
+
wandb.init(
|
35 |
+
job_type="app",
|
36 |
+
project=project,
|
37 |
+
entity=entity,
|
38 |
+
config=dict(
|
39 |
+
state_dict_path=state_dict_path,
|
40 |
+
movie_lens_25m_directory=movie_lens_25m_directory,
|
41 |
+
),
|
42 |
+
)
|
43 |
app.launch()
|
svd.pt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cb328eda7e910c0d8d962394f5625af297b495a5f7dd4b73035e7ffffbef81e0
|
3 |
+
size 1227943783
|