Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,17 +3,13 @@ from sklearn.feature_extraction.text import TfidfVectorizer
|
|
3 |
from sklearn.metrics.pairwise import linear_kernel
|
4 |
import gradio as gr
|
5 |
import zipfile
|
6 |
-
import requests
|
7 |
-
import io
|
8 |
import random
|
9 |
|
10 |
input_count = 300
|
11 |
result_count = 21
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
-
response = requests.get(url)
|
16 |
-
with zipfile.ZipFile(io.BytesIO(response.content)) as z:
|
17 |
with z.open('ml-latest-small/movies.csv') as f:
|
18 |
movies = pd.read_csv(f)
|
19 |
|
|
|
3 |
from sklearn.metrics.pairwise import linear_kernel
|
4 |
import gradio as gr
|
5 |
import zipfile
|
|
|
|
|
6 |
import random
|
7 |
|
8 |
input_count = 300
|
9 |
result_count = 21
|
10 |
|
11 |
+
# Extract the MovieLens dataset
|
12 |
+
with zipfile.ZipFile('ml-latest-small.zip') as z:
|
|
|
|
|
13 |
with z.open('ml-latest-small/movies.csv') as f:
|
14 |
movies = pd.read_csv(f)
|
15 |
|