Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,28 @@
|
|
1 |
# Use a pipeline as a high-level helper
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
|
|
4 |
|
5 |
pipe_1 = pipeline("text-classification", model="mavinsao/mi-roberta-base-finetuned-mental-illness")
|
6 |
pipe_2 = pipeline("text-classification", model="mavinsao/roberta-mental-finetuned")
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
def ensemble_predict(text):
|
10 |
# Store results from each model
|
11 |
results_1 = pipe_1(text)
|
|
|
1 |
# Use a pipeline as a high-level helper
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
+
import streamlit.components.v1 as components
|
5 |
|
6 |
pipe_1 = pipeline("text-classification", model="mavinsao/mi-roberta-base-finetuned-mental-illness")
|
7 |
pipe_2 = pipeline("text-classification", model="mavinsao/roberta-mental-finetuned")
|
8 |
|
9 |
|
10 |
+
# Streamlit app with background image
|
11 |
+
def st_display_background(image_url):
|
12 |
+
st_style = f"""
|
13 |
+
<style>
|
14 |
+
body {{
|
15 |
+
background-image: url("{image_url}");
|
16 |
+
background-size: cover;
|
17 |
+
}}
|
18 |
+
</style>
|
19 |
+
"""
|
20 |
+
st.markdown(st_style, unsafe_allow_html=True)
|
21 |
+
|
22 |
+
image_url = "https://images.unsplash.com/photo-1504701954957-2010ec3bcec1?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
23 |
+
st_display_background(image_url)
|
24 |
+
|
25 |
+
|
26 |
def ensemble_predict(text):
|
27 |
# Store results from each model
|
28 |
results_1 = pipe_1(text)
|