Spaces:
Runtime error
Runtime error
dkoshman
commited on
Commit
•
962fcee
1
Parent(s):
f53c333
Revert "my_recommending==0.1.18, 50 imdb recs"
Browse filesThis reverts commit 3047c048
- app.py +5 -7
- requirements.txt +1 -1
app.py
CHANGED
@@ -12,25 +12,23 @@ project = "Recommending"
|
|
12 |
tmdb_api_token = os.environ["TMDB_API_TOKEN"]
|
13 |
lightning_class = MovieLensNonGradientRecommender
|
14 |
config = dict(
|
15 |
-
model_artifact="
|
16 |
-
data_artifact="movielens25m:
|
17 |
media_directory="media",
|
18 |
-
n_recommendations_from_imdb_ratings=
|
19 |
)
|
20 |
|
21 |
wandb.init(job_type="app", project=project, config=config)
|
22 |
|
23 |
-
data_artifact = wandb.use_artifact(config["data_artifact"])
|
24 |
-
data_directory = data_artifact.download()
|
25 |
-
|
26 |
model_artifact = wandb.use_artifact(config["model_artifact"])
|
27 |
checkpoint_path = model_artifact.file()
|
28 |
-
|
29 |
lightning_module = lightning_class.load_from_checkpoint(
|
30 |
checkpoint_path, map_location="cpu"
|
31 |
)
|
32 |
recommender = lightning_module.model.eval()
|
33 |
|
|
|
|
|
34 |
movielens = MovieLens25m(directory=data_directory)
|
35 |
movie_markdown_generator = MovieMarkdownGenerator(
|
36 |
movielens=movielens, tmdb_api_token=tmdb_api_token
|
|
|
12 |
tmdb_api_token = os.environ["TMDB_API_TOKEN"]
|
13 |
lightning_class = MovieLensNonGradientRecommender
|
14 |
config = dict(
|
15 |
+
model_artifact="my_mf_slim_movielens_25m:latest",
|
16 |
+
data_artifact="movielens25m:latest",
|
17 |
media_directory="media",
|
18 |
+
n_recommendations_from_imdb_ratings=20,
|
19 |
)
|
20 |
|
21 |
wandb.init(job_type="app", project=project, config=config)
|
22 |
|
|
|
|
|
|
|
23 |
model_artifact = wandb.use_artifact(config["model_artifact"])
|
24 |
checkpoint_path = model_artifact.file()
|
|
|
25 |
lightning_module = lightning_class.load_from_checkpoint(
|
26 |
checkpoint_path, map_location="cpu"
|
27 |
)
|
28 |
recommender = lightning_module.model.eval()
|
29 |
|
30 |
+
data_artifact = wandb.use_artifact(config["data_artifact"])
|
31 |
+
data_directory = data_artifact.download()
|
32 |
movielens = MovieLens25m(directory=data_directory)
|
33 |
movie_markdown_generator = MovieMarkdownGenerator(
|
34 |
movielens=movielens, tmdb_api_token=tmdb_api_token
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
my_recommending==0.1.
|
|
|
1 |
+
my_recommending==0.1.17
|