Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,45 +3,10 @@ from bs4 import BeautifulSoup
|
|
3 |
import requests
|
4 |
import re
|
5 |
import pandas as pd
|
6 |
-
from theme_dropdown import create_theme_dropdown # noqa: F401
|
7 |
|
8 |
import gradio as gr
|
9 |
|
10 |
-
|
11 |
-
with gr.Blocks(theme='gstaff/xkcd') as demo:
|
12 |
-
with gr.Row().style(equal_height=True):
|
13 |
-
with gr.Column(scale=10):
|
14 |
-
gr.Markdown(
|
15 |
-
"""
|
16 |
-
# Theme preview: `xkcd`
|
17 |
-
To use this theme, set `theme='gstaff/xkcd'` in `gr.Blocks()` or `gr.Interface()`.
|
18 |
-
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
19 |
-
of this theme.
|
20 |
-
"""
|
21 |
-
)
|
22 |
-
with gr.Column(scale=3):
|
23 |
-
with gr.Box():
|
24 |
-
dropdown.render()
|
25 |
-
toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
|
26 |
-
|
27 |
-
dropdown.change(None, dropdown, None, _js=js)
|
28 |
-
toggle_dark.click(
|
29 |
-
None,
|
30 |
-
_js="""
|
31 |
-
() => {
|
32 |
-
document.body.classList.toggle('dark');
|
33 |
-
document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
|
34 |
-
}
|
35 |
-
""",
|
36 |
-
)
|
37 |
-
|
38 |
-
name = gr.Textbox(
|
39 |
-
label="Name",
|
40 |
-
info="Full name, including middle name. No special characters.",
|
41 |
-
placeholder="John Doe",
|
42 |
-
value="John Doe",
|
43 |
-
interactive=True,
|
44 |
-
)
|
45 |
|
46 |
def get_video_address(row):
|
47 |
|
@@ -129,14 +94,12 @@ def combine(x):
|
|
129 |
np.nan
|
130 |
|
131 |
|
132 |
-
import requests
|
133 |
headers = {
|
134 |
"accept": "application/json",
|
135 |
"Authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmMTNkMmNiMTY4MWM3ZWEyMjNiYjgxZTUyYmMzMDUyMCIsInN1YiI6IjY0YTY5MTU1YzNiZmZlMDBjODZiYzRlZSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.H6zk_gSiudNdZTsgwYHFQnJiVXfR_BX5DfYNIoIsRv8"
|
136 |
}
|
137 |
|
138 |
|
139 |
-
import requests
|
140 |
def recommend_movie(movie_name, Number_of_Recommendation):
|
141 |
Number_of_Recommendation = int(Number_of_Recommendation)
|
142 |
outputIds = ['tt0114709', 'tt0113497', 'tt0113228', 'tt0114885', 'tt0113041']
|
@@ -214,7 +177,7 @@ iface = gr.Interface(fn=recommend_movie,
|
|
214 |
title="Movie Recommender",
|
215 |
description="Enter a movie name and your rating (out of 10) for the movie. you must enter at least 3 movies and all words must start with capital letters, example : Grumpier Old Men",
|
216 |
css = css_code,
|
217 |
-
theme=
|
218 |
)
|
219 |
|
220 |
iface.launch()
|
|
|
3 |
import requests
|
4 |
import re
|
5 |
import pandas as pd
|
|
|
6 |
|
7 |
import gradio as gr
|
8 |
|
9 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def get_video_address(row):
|
12 |
|
|
|
94 |
np.nan
|
95 |
|
96 |
|
|
|
97 |
headers = {
|
98 |
"accept": "application/json",
|
99 |
"Authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmMTNkMmNiMTY4MWM3ZWEyMjNiYjgxZTUyYmMzMDUyMCIsInN1YiI6IjY0YTY5MTU1YzNiZmZlMDBjODZiYzRlZSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.H6zk_gSiudNdZTsgwYHFQnJiVXfR_BX5DfYNIoIsRv8"
|
100 |
}
|
101 |
|
102 |
|
|
|
103 |
def recommend_movie(movie_name, Number_of_Recommendation):
|
104 |
Number_of_Recommendation = int(Number_of_Recommendation)
|
105 |
outputIds = ['tt0114709', 'tt0113497', 'tt0113228', 'tt0114885', 'tt0113041']
|
|
|
177 |
title="Movie Recommender",
|
178 |
description="Enter a movie name and your rating (out of 10) for the movie. you must enter at least 3 movies and all words must start with capital letters, example : Grumpier Old Men",
|
179 |
css = css_code,
|
180 |
+
theme='taithrah/Minimal'
|
181 |
)
|
182 |
|
183 |
iface.launch()
|