miscjose commited on
Commit
500010a
·
1 Parent(s): d6fccec

updated theme

Browse files
Files changed (3) hide show
  1. app.py +6 -5
  2. embed.py +3 -5
  3. embeddings/data.json +2 -2
app.py CHANGED
@@ -90,7 +90,7 @@ if __name__ == '__main__':
90
  embeddings = data['embeddings']
91
  filters = data['filters']
92
 
93
- with gr.Blocks() as demo:
94
  with gr.Row():
95
  with gr.Column(visible=True) as input_col:
96
  query = gr.Textbox(label="What are you looking for?")
@@ -104,7 +104,8 @@ if __name__ == '__main__':
104
 
105
  examples = gr.Examples(
106
  examples=[
107
- ['A show about pirates with super powers in search of gold', 3, ['Action', 'Adventure', 'Fantasy'], ['ALL'], ['PG-13 - Teens 13 or older'], .8, .2]
 
108
  ],
109
  inputs=[query, number_of_recommendations, genres, themes, rating, objective_weight, subjective_weight],
110
  )
@@ -114,10 +115,10 @@ if __name__ == '__main__':
114
  for i in range(15):
115
  with gr.Row():
116
  with gr.Column():
117
- outputs.append(gr.Image(f"Image {i}", height=435, width=500, visible=False))
118
  with gr.Column():
119
- outputs.append(gr.Textbox(label=f"Recommendation {i}", max_lines=7, visible=False))
120
- outputs.append(gr.Textbox(label=f"Best User Review", max_lines=7, visible=False))
121
 
122
  submit_btn.click(
123
  get_recommendation,
 
90
  embeddings = data['embeddings']
91
  filters = data['filters']
92
 
93
+ with gr.Blocks(theme=gr.themes.Soft(primary_hue='blue')) as demo:
94
  with gr.Row():
95
  with gr.Column(visible=True) as input_col:
96
  query = gr.Textbox(label="What are you looking for?")
 
104
 
105
  examples = gr.Examples(
106
  examples=[
107
+ ['Pirates with Super Powers!', 3, ['Action', 'Adventure', 'Fantasy'], ['ALL'], ['PG-13 - Teens 13 or older'], .8, .2],
108
+ ['Murder mystery where the murderer is not human', 5, ['Suspense', 'Sci-Fi', 'Horror'], ['ALL'], ['R - 17+ (violence & profanity)'], .4, .6],
109
  ],
110
  inputs=[query, number_of_recommendations, genres, themes, rating, objective_weight, subjective_weight],
111
  )
 
115
  for i in range(15):
116
  with gr.Row():
117
  with gr.Column():
118
+ outputs.append(gr.Image(height=435, width=500, visible=False))
119
  with gr.Column():
120
+ outputs.append(gr.Textbox(max_lines=7, visible=False))
121
+ outputs.append(gr.Textbox(max_lines=7, visible=False))
122
 
123
  submit_btn.click(
124
  get_recommendation,
embed.py CHANGED
@@ -22,6 +22,9 @@ def clean_filters(filters):
22
  return filters
23
 
24
  if __name__ == '__main__':
 
 
 
25
  filters = {
26
  'genres': set(),
27
  'themes': set(),
@@ -29,7 +32,6 @@ if __name__ == '__main__':
29
  }
30
 
31
  embeddings = {}
32
- i=0
33
  for name in os.listdir('./anime'):
34
  with open(f"./anime/{name}", 'r') as file:
35
  data = json.load(file)
@@ -37,10 +39,6 @@ if __name__ == '__main__':
37
  if not data:
38
  continue
39
 
40
- i+=1
41
- if i==100:
42
- break
43
-
44
  filters = update_filters(filters, data)
45
 
46
  name = name.replace('.json', '')
 
22
  return filters
23
 
24
  if __name__ == '__main__':
25
+
26
+ print('Embedding Started')
27
+
28
  filters = {
29
  'genres': set(),
30
  'themes': set(),
 
32
  }
33
 
34
  embeddings = {}
 
35
  for name in os.listdir('./anime'):
36
  with open(f"./anime/{name}", 'r') as file:
37
  data = json.load(file)
 
39
  if not data:
40
  continue
41
 
 
 
 
 
42
  filters = update_filters(filters, data)
43
 
44
  name = name.replace('.json', '')
embeddings/data.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:437b0920ac45bccab807a0c32af8f8dde6d902e81a270607a0b3bafaeca4044b
3
- size 11076672
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9438958157c4deb3549825d69a38a5a63ff0afc1c986831a97fab70906910110
3
+ size 227553275