georad commited on
Commit
2e6a9a9
Β·
verified Β·
1 Parent(s): d534866

Update pages/type_text.py

Browse files
Files changed (1) hide show
  1. pages/type_text.py +5 -8
pages/type_text.py CHANGED
@@ -3,10 +3,8 @@ import pandas as pd
3
  from io import StringIO
4
  import json
5
  import torch
6
- from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM #AutoModelForTokenClassification
7
  from sentence_transformers import SentenceTransformer, util
8
- #import lmdeploy
9
- #import turbomind as tm
10
 
11
  import os
12
  os.getenv("HF_TOKEN")
@@ -30,15 +28,13 @@ def convert_json(df:pd.DataFrame):
30
  #st.json(json_string, expanded=True)
31
  return json_string
32
 
33
- #st.title("πŸ“˜SBS mapper")
34
-
35
  INTdesc_input = st.text_input("Type internal description and hit Enter", key="user_input")
36
 
37
  createSBScodes, right_column = st.columns(2)
38
  createSBScodes_clicked = createSBScodes.button("Map to SBS codes", key="user_createSBScodes")
39
  right_column.button("Reset", on_click=on_click)
40
-
41
- numMAPPINGS_input = 5
42
  #numMAPPINGS_input = st.text_input("Type number of mappings and hit Enter", key="user_input_numMAPPINGS")
43
  #st.button("Clear text", on_click=on_click)
44
 
@@ -128,4 +124,5 @@ if INTdesc_input is not None and createSBScodes_clicked == True:
128
  textbutton = st.download_button(label="πŸ“₯ Download .txt", data=convert_df(dfALL), file_name= "results.text", mime='text/plain', key='text_b')
129
  with b3:
130
  #jsonbutton = download_button(results, "results.json", "πŸ“₯ Download .json")
131
- jsonbutton = st.download_button(label="πŸ“₯ Download .json", data=convert_json(dfALL), file_name= "results.json", mime='application/json', key='json_b')
 
 
3
  from io import StringIO
4
  import json
5
  import torch
6
+ from transformers import pipeline, # AutoTokenizer, AutoModelForCausalLM, AutoModelForTokenClassification
7
  from sentence_transformers import SentenceTransformer, util
 
 
8
 
9
  import os
10
  os.getenv("HF_TOKEN")
 
28
  #st.json(json_string, expanded=True)
29
  return json_string
30
 
 
 
31
  INTdesc_input = st.text_input("Type internal description and hit Enter", key="user_input")
32
 
33
  createSBScodes, right_column = st.columns(2)
34
  createSBScodes_clicked = createSBScodes.button("Map to SBS codes", key="user_createSBScodes")
35
  right_column.button("Reset", on_click=on_click)
36
+ """
37
+ #numMAPPINGS_input = 5
38
  #numMAPPINGS_input = st.text_input("Type number of mappings and hit Enter", key="user_input_numMAPPINGS")
39
  #st.button("Clear text", on_click=on_click)
40
 
 
124
  textbutton = st.download_button(label="πŸ“₯ Download .txt", data=convert_df(dfALL), file_name= "results.text", mime='text/plain', key='text_b')
125
  with b3:
126
  #jsonbutton = download_button(results, "results.json", "πŸ“₯ Download .json")
127
+ jsonbutton = st.download_button(label="πŸ“₯ Download .json", data=convert_json(dfALL), file_name= "results.json", mime='application/json', key='json_b')
128
+ """