Spaces:
Sleeping
Sleeping
fix
Browse files
app.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import numpy as np
|
| 3 |
-
import pandas as pd
|
| 4 |
from fastai.learner import load_learner
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
learn = load_learner(
|
| 7 |
|
| 8 |
dados = pd.read_csv('valid.csv')
|
| 9 |
ids = dados['user'].unique()
|
|
@@ -28,6 +28,12 @@ def top5(user):
|
|
| 28 |
|
| 29 |
return '\n'.join(top_5['title'].tolist())
|
| 30 |
|
| 31 |
-
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
iface.launch(share=True)
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
from fastai.learner import load_learner
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import numpy as np
|
| 5 |
|
| 6 |
+
learn = load_learner('model.pkl')
|
| 7 |
|
| 8 |
dados = pd.read_csv('valid.csv')
|
| 9 |
ids = dados['user'].unique()
|
|
|
|
| 28 |
|
| 29 |
return '\n'.join(top_5['title'].tolist())
|
| 30 |
|
| 31 |
+
iface = gr.Interface(
|
| 32 |
+
fn=top5,
|
| 33 |
+
inputs=gr.Dropdown(choices=id_list),
|
| 34 |
+
outputs="text",
|
| 35 |
+
title="Books Recommendation",
|
| 36 |
+
description="This model is responsible for a recommendation system involving books and their ratings.",
|
| 37 |
+
)
|
| 38 |
|
| 39 |
iface.launch(share=True)
|