Spaces:
Sleeping
Sleeping
Pavel Malov commited on
Commit ·
12d1592
1
Parent(s): 5eae5da
Add caching
Browse files
app.py
CHANGED
|
@@ -9,7 +9,12 @@ st.write("This app helps define category of your scientific paper based on its n
|
|
| 9 |
name = st.text_input("Paste here name of your paper")
|
| 10 |
abstract = st.text_area("Paste here abstract of your paper")
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
model.inference('load')
|
| 14 |
|
| 15 |
# if name != '':
|
|
|
|
| 9 |
name = st.text_input("Paste here name of your paper")
|
| 10 |
abstract = st.text_area("Paste here abstract of your paper")
|
| 11 |
|
| 12 |
+
|
| 13 |
+
@st.cache_resource # 👈 Add the caching decorator
|
| 14 |
+
def load_model():
|
| 15 |
+
return InferenceModel()
|
| 16 |
+
|
| 17 |
+
model = load_model()
|
| 18 |
model.inference('load')
|
| 19 |
|
| 20 |
# if name != '':
|