Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,20 +14,12 @@ def load_model(model_name):
|
|
| 14 |
AutoTokenizer.from_pretrained(model_name),
|
| 15 |
)
|
| 16 |
|
| 17 |
-
print ("before main")
|
| 18 |
|
| 19 |
st.title("Transformers Interpet Demo App")
|
| 20 |
|
| 21 |
-
print ("before main")
|
| 22 |
-
|
| 23 |
-
#image = Image.open("./images/tight@1920x_transparent.png")
|
| 24 |
-
#st.sidebar.image(image, use_column_width=True)
|
| 25 |
st.sidebar.markdown(
|
| 26 |
"Check out the package on [Github](https://github.com/cdpierse/transformers-interpret)"
|
| 27 |
)
|
| 28 |
-
st.info(
|
| 29 |
-
"Due to limited resources only low memory models are available. Run this [app locally](https://github.com/cdpierse/transformers-interpret-streamlit) to run the full selection of available models. "
|
| 30 |
-
)
|
| 31 |
|
| 32 |
# uncomment the options below to test out the app with a variety of classification models.
|
| 33 |
models = {
|
|
@@ -85,12 +77,6 @@ text = st.text_area(
|
|
| 85 |
height=400,
|
| 86 |
max_chars=850,
|
| 87 |
)
|
| 88 |
-
print ("Before button")
|
| 89 |
-
if st.button('Say hello'):
|
| 90 |
-
st.write('Why hello there')
|
| 91 |
-
else:
|
| 92 |
-
st.write('Goodbye')
|
| 93 |
-
print ("After test button")
|
| 94 |
|
| 95 |
if st.button("Interpret Text"):
|
| 96 |
#print_memory_usage()
|
|
@@ -121,9 +107,4 @@ if st.button("Interpret Text"):
|
|
| 121 |
)
|
| 122 |
print ("end of stuff")
|
| 123 |
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
print ("end of total file")
|
|
|
|
| 14 |
AutoTokenizer.from_pretrained(model_name),
|
| 15 |
)
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
st.title("Transformers Interpet Demo App")
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
st.sidebar.markdown(
|
| 21 |
"Check out the package on [Github](https://github.com/cdpierse/transformers-interpret)"
|
| 22 |
)
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# uncomment the options below to test out the app with a variety of classification models.
|
| 25 |
models = {
|
|
|
|
| 77 |
height=400,
|
| 78 |
max_chars=850,
|
| 79 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
if st.button("Interpret Text"):
|
| 82 |
#print_memory_usage()
|
|
|
|
| 107 |
)
|
| 108 |
print ("end of stuff")
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
print ("end of total file")
|