Update pages/type_text.py
Browse files- pages/type_text.py +4 -5
pages/type_text.py
CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
|
|
2 |
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 |
|
@@ -13,8 +13,8 @@ def get_device_map() -> str:
|
|
13 |
return 'cuda' if torch.cuda.is_available() else 'cpu'
|
14 |
device = get_device_map() # 'cpu'
|
15 |
|
16 |
-
def on_click():
|
17 |
-
st.session_state.user_input = ""
|
18 |
|
19 |
#@st.cache
|
20 |
def convert_df(df:pd.DataFrame):
|
@@ -33,7 +33,7 @@ INTdesc_input = st.text_input("Type internal description and hit Enter", key="us
|
|
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)
|
@@ -125,4 +125,3 @@ if INTdesc_input is not None and createSBScodes_clicked == True:
|
|
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 |
-
"""
|
|
|
2 |
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 |
|
|
|
13 |
return 'cuda' if torch.cuda.is_available() else 'cpu'
|
14 |
device = get_device_map() # 'cpu'
|
15 |
|
16 |
+
#def on_click():
|
17 |
+
# st.session_state.user_input = ""
|
18 |
|
19 |
#@st.cache
|
20 |
def convert_df(df:pd.DataFrame):
|
|
|
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)
|
|
|
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')
|
|