Oleksii Horhcynskyi commited on
Commit
26310fb
·
1 Parent(s): 879dab1

refactoring, minor bug fix in list displaying

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,9 +32,9 @@ if 'sentences' not in st.session_state:
32
  st.session_state['s_i'] = 0
33
  st.session_state['sentences'] = []
34
 
 
35
  st.title('Playground')
36
 
37
- # layout
38
  left_column, right_column = st.columns([1, 1], gap='large', border=True)
39
 
40
  # sentences
@@ -53,7 +53,7 @@ with left_column:
53
  st.session_state['sentences'][st.session_state['s_i']] = text_input
54
 
55
  st.session_state['s_i'] += 1
56
- if st.session_state['s_i'] == 5:
57
  st.session_state['s_i'] = 0
58
 
59
  with sub_right:
@@ -67,7 +67,7 @@ with left_column:
67
  # embeds display
68
  with (right_column):
69
  st.subheader('xlm-roberta-ua-distilled')
70
- proj_points = None
71
  if compute_btn := st.button('Compute', icon='🤖'):
72
  # calculating embeddings
73
  embeds = get_model().encode(st.session_state['sentences'])
 
32
  st.session_state['s_i'] = 0
33
  st.session_state['sentences'] = []
34
 
35
+ # layout
36
  st.title('Playground')
37
 
 
38
  left_column, right_column = st.columns([1, 1], gap='large', border=True)
39
 
40
  # sentences
 
53
  st.session_state['sentences'][st.session_state['s_i']] = text_input
54
 
55
  st.session_state['s_i'] += 1
56
+ if st.session_state['s_i'] == LIST_SIZE:
57
  st.session_state['s_i'] = 0
58
 
59
  with sub_right:
 
67
  # embeds display
68
  with (right_column):
69
  st.subheader('xlm-roberta-ua-distilled')
70
+
71
  if compute_btn := st.button('Compute', icon='🤖'):
72
  # calculating embeddings
73
  embeds = get_model().encode(st.session_state['sentences'])