Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
#import asyncio
|
2 |
-
#import gc
|
3 |
-
#import logging
|
4 |
import os
|
5 |
-
|
6 |
import pandas as pd
|
7 |
-
#import psutil
|
8 |
import streamlit as st
|
9 |
#from PIL import Image
|
10 |
from streamlit import components
|
11 |
-
#from streamlit.caching import clear_cache
|
12 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
13 |
from transformers_interpret import SequenceClassificationExplainer
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
#os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
16 |
#logging.basicConfig(
|
17 |
# format="%(asctime)s : %(levelname)s : %(message)s", level=logging.INFO
|
@@ -22,18 +22,6 @@ from transformers_interpret import SequenceClassificationExplainer
|
|
22 |
# logging.info(f"RAM memory % used: {psutil.virtual_memory()[2]}")
|
23 |
|
24 |
|
25 |
-
@st.cache(allow_output_mutation=True, suppress_st_warning=True, max_entries=1)
|
26 |
-
|
27 |
-
def load_model(model_name):
|
28 |
-
return (
|
29 |
-
AutoModelForSequenceClassification.from_pretrained(model_name),
|
30 |
-
AutoTokenizer.from_pretrained(model_name),
|
31 |
-
)
|
32 |
-
|
33 |
-
print ("before main")
|
34 |
-
|
35 |
-
|
36 |
-
st.title("Transformers Interpet Demo App")
|
37 |
|
38 |
|
39 |
|
|
|
|
|
|
|
|
|
1 |
import os
|
|
|
2 |
import pandas as pd
|
|
|
3 |
import streamlit as st
|
4 |
#from PIL import Image
|
5 |
from streamlit import components
|
|
|
6 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
7 |
from transformers_interpret import SequenceClassificationExplainer
|
8 |
|
9 |
+
st.title("Hello World!")
|
10 |
+
|
11 |
+
st.write(pathlib.Path.home())
|
12 |
+
|
13 |
+
st.write(pydicom)
|
14 |
+
|
15 |
#os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
16 |
#logging.basicConfig(
|
17 |
# format="%(asctime)s : %(levelname)s : %(message)s", level=logging.INFO
|
|
|
22 |
# logging.info(f"RAM memory % used: {psutil.virtual_memory()[2]}")
|
23 |
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
|