Kdnv commited on
Commit
ccd93f0
·
1 Parent(s): fb5842f

app search speed update

Browse files
Files changed (1) hide show
  1. app.py +21 -9
app.py CHANGED
@@ -10,7 +10,7 @@ if 'button_clicked' not in st.session_state:
10
 
11
 
12
  def show_serial(number, score=None):
13
- with st.form(key=f'Сериал_{number}'):
14
  col1, col2, col3 = st.columns(3)
15
 
16
  with col1:
@@ -22,20 +22,34 @@ def show_serial(number, score=None):
22
  if score:
23
  st.write(f'{score[1]} metric: {score[0]:.4f}')
24
  with col3:
 
25
  with st.popover('Описание'):
26
  st.write(data.iloc[number, 4])
27
- st.caption('Ссылка')
28
- st.caption(data.iloc[number, 0])
29
- if st.form_submit_button('Обновить'):
30
- pass
31
 
32
 
33
- st.title('Генератор случайных сериалов')
34
  st.divider()
35
 
36
  data = pd.read_csv('data/data.csv', index_col=0)
37
 
38
- if st.button('Дай 10 сериалов', use_container_width=True):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  st.session_state.button_clicked = True
40
  st.session_state.selected_series = None
41
 
@@ -43,5 +57,3 @@ if st.session_state.button_clicked:
43
  for _ in range(10):
44
  number = random.randint(0, data.shape[0] - 1)
45
  show_serial(number)
46
-
47
-
 
10
 
11
 
12
  def show_serial(number, score=None):
13
+ with st.container(border=True):
14
  col1, col2, col3 = st.columns(3)
15
 
16
  with col1:
 
22
  if score:
23
  st.write(f'{score[1]} metric: {score[0]:.4f}')
24
  with col3:
25
+ st.markdown(f'[Ссылка]({data.iloc[number, 0]})')
26
  with st.popover('Описание'):
27
  st.write(data.iloc[number, 4])
 
 
 
 
28
 
29
 
30
+ st.title('Рекомендатор сериалов')
31
  st.divider()
32
 
33
  data = pd.read_csv('data/data.csv', index_col=0)
34
 
35
+ cols = st.columns(4)
36
+ with cols[0]:
37
+ st.markdown('<p style="text-align: center; font-weight: bold;">Количество сериалов</p>', unsafe_allow_html=True)
38
+ st.markdown('<p style="text-align: center;">5000</p>', unsafe_allow_html=True)
39
+
40
+ with cols[1]:
41
+ st.markdown('<p style="text-align: center; font-weight: bold;">Источник парсинга</p>', unsafe_allow_html=True)
42
+ st.markdown('<p style="text-align: center;"><a href="https://www.film.ru/a-z/serials" target="_blank">Перейти на сайт</a></p>', unsafe_allow_html=True)
43
+
44
+ with cols[2]:
45
+ st.markdown('<p style="text-align: center; font-weight: bold;">Время парсинга</p>', unsafe_allow_html=True)
46
+ st.markdown('<p style="text-align: center;">27 минут</p>', unsafe_allow_html=True)
47
+
48
+ with cols[3]:
49
+ st.markdown('<p style="text-align: center; font-weight: bold;">Модель</p>', unsafe_allow_html=True)
50
+ st.markdown('<p style="text-align: center;"><a href="https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2" target="_blank">multilingual-mpnet-base-v2</a></p>', unsafe_allow_html=True)
51
+
52
+ if st.button('Дай 10 случайных сериалов', use_container_width=True):
53
  st.session_state.button_clicked = True
54
  st.session_state.selected_series = None
55
 
 
57
  for _ in range(10):
58
  number = random.randint(0, data.shape[0] - 1)
59
  show_serial(number)