georad commited on
Commit
90d3bc9
·
verified ·
1 Parent(s): 383e99f

Update pages/type_text.py

Browse files
Files changed (1) hide show
  1. pages/type_text.py +5 -5
pages/type_text.py CHANGED
@@ -159,6 +159,11 @@ pipe = load_pipe()
159
  INTdesc_embedding = model.encode(INTdesc_input)
160
  SBScorpus_embeddings = model.encode(SBScorpus)
161
 
 
 
 
 
 
162
  if INTdesc_input is not None and st.button("Map to SBS codes"):
163
  HF_model_results = util.semantic_search(INTdesc_embedding, SBScorpus_embeddings)
164
  HF_model_results_sorted = sorted(HF_model_results, key=lambda x: x[1], reverse=True)
@@ -185,11 +190,6 @@ if INTdesc_input is not None and st.button("Map to SBS codes"):
185
  prompt = question + " " +"A: "+ shortlist[0] + " " +"B: " + shortlist[1] + " " + "C: " + shortlist[2] + " " + "D: " + shortlist[3] + " " + "E: " + shortlist[4]
186
  #st.write(prompt)
187
 
188
- sp = iter(make_spinner()) # this starts the spinning
189
- next(sp) # heavy computation
190
- time.sleep(3) # spinning end
191
- next(sp, None)
192
-
193
  messages = [
194
  {"role": "system", "content": "You are a knowledgable AI assistant who always answers truthfully and precisely!"},
195
  {"role": "user", "content": prompt},
 
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)
169
  HF_model_results_sorted = sorted(HF_model_results, key=lambda x: x[1], reverse=True)
 
190
  prompt = question + " " +"A: "+ shortlist[0] + " " +"B: " + shortlist[1] + " " + "C: " + shortlist[2] + " " + "D: " + shortlist[3] + " " + "E: " + shortlist[4]
191
  #st.write(prompt)
192
 
 
 
 
 
 
193
  messages = [
194
  {"role": "system", "content": "You are a knowledgable AI assistant who always answers truthfully and precisely!"},
195
  {"role": "user", "content": prompt},