voroninip commited on
Commit
7c1c7bc
·
verified ·
1 Parent(s): 1780240

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -1,10 +1,17 @@
1
  import streamlit as st
 
2
  from transformers import pipeline
3
 
4
 
 
 
 
 
 
 
5
  @st.cache_resource # кэширование
6
  def load_model():
7
- return pipeline("text-classification", model="Wi/arxiv-distilbert-base-cased") # скачивание модели
8
 
9
  model = load_model()
10
 
@@ -84,6 +91,7 @@ if query:
84
  Most likely categories of the paper:
85
  </p>
86
  """, unsafe_allow_html=True)
87
- result = format_predictions(top_pct(model(query)[0]))
88
-
 
89
  st.write(result)
 
1
  import streamlit as st
2
+ # from transformers import init_empty_weights
3
  from transformers import pipeline
4
 
5
 
6
+ # @st.cache_resource # кэширование
7
+ # def load_model():
8
+ # return pipeline("text-classification", model="Wi/arxiv-distilbert-base-cased") # скачивание модели
9
+ #
10
+ # model = load_model()
11
+
12
  @st.cache_resource # кэширование
13
  def load_model():
14
+ return pipeline("sentiment-analysis") # скачивание модели
15
 
16
  model = load_model()
17
 
 
91
  Most likely categories of the paper:
92
  </p>
93
  """, unsafe_allow_html=True)
94
+ # result = format_predictions(top_pct(model(query)[0]))
95
+ # result = query
96
+ result = model(query)[0]
97
  st.write(result)