georad commited on
Commit
98355db
·
verified ·
1 Parent(s): fcaa735

Update pages/type_text.py

Browse files
Files changed (1) hide show
  1. pages/type_text.py +11 -6
pages/type_text.py CHANGED
@@ -159,10 +159,10 @@ pipe = load_pipe()
159
  INTdesc_embedding = model.encode(INTdesc_input)
160
  SBScorpus_embeddings = model.encode(SBScorpus)
161
 
162
- sp = iter(make_spinner()) # this starts the spinning
163
- next(sp) # heavy computation
164
- time.sleep(3) # spinning end
165
- next(sp, None)
166
 
167
  if INTdesc_input is not None and st.button("Map to SBS codes"):
168
  HF_model_results = util.semantic_search(INTdesc_embedding, SBScorpus_embeddings)
@@ -198,8 +198,13 @@ if INTdesc_input is not None and st.button("Map to SBS codes"):
198
  messages,
199
  max_new_tokens=256,
200
  )
201
- st.write(outputs[0]["generated_text"][-1]["content"])
202
-
 
 
 
 
 
203
  bs, b1, b2, b3, bLast = st.columns([0.75, 1.5, 1.5, 1.5, 0.75])
204
  with b1:
205
  #csvbutton = download_button(results, "results.csv", "📥 Download .csv")
 
159
  INTdesc_embedding = model.encode(INTdesc_input)
160
  SBScorpus_embeddings = model.encode(SBScorpus)
161
 
162
+ #sp = iter(make_spinner()) # this starts the spinning
163
+ #next(sp) # heavy computation
164
+ #time.sleep(3) # spinning end
165
+ #next(sp, None)
166
 
167
  if INTdesc_input is not None and st.button("Map to SBS codes"):
168
  HF_model_results = util.semantic_search(INTdesc_embedding, SBScorpus_embeddings)
 
198
  messages,
199
  max_new_tokens=256,
200
  )
201
+ st.write(outputs[0]["generated_text"][-1]["content"])
202
+
203
+ sp = iter(make_spinner()) # this starts the spinning
204
+ next(sp) # heavy computation
205
+ time.sleep(15) # spinning end
206
+ next(sp, None)
207
+
208
  bs, b1, b2, b3, bLast = st.columns([0.75, 1.5, 1.5, 1.5, 0.75])
209
  with b1:
210
  #csvbutton = download_button(results, "results.csv", "📥 Download .csv")