- updates for webm generation
Browse files
app.py
CHANGED
@@ -13,8 +13,9 @@ st.title("Towards a Programmable Humanizing AI through Scalable Stance-Directed
|
|
13 |
|
14 |
|
15 |
# Container for ideology selection spanning across first two columns
|
16 |
-
|
17 |
-
|
|
|
18 |
model_selection = st.selectbox(
|
19 |
"Select an ideology",
|
20 |
options=['Left', 'Right'],
|
@@ -22,29 +23,28 @@ with col1:
|
|
22 |
)
|
23 |
|
24 |
# Layout for entities and aspects inputs
|
25 |
-
with
|
26 |
st.header("Entities")
|
27 |
pro_entities = st.text_input("Pro Entities", help="Enter pro entities separated by commas")
|
28 |
anti_entities = st.text_input("Anti Entities", help="Enter anti entities separated by commas")
|
29 |
neutral_entities = st.text_input("Neutral Entities", help="Enter neutral entities separated by commas")
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
with col3:
|
34 |
st.header("Aspects")
|
35 |
pro_aspects = st.text_input("Pro Aspects", help="Enter pro aspects separated by commas")
|
36 |
anti_aspects = st.text_input("Anti Aspects", help="Enter anti aspects separated by commas")
|
37 |
neutral_aspects = st.text_input("Neutral Aspects", help="Enter neutral aspects separated by commas")
|
38 |
|
39 |
# Generate button (placed outside the columns so it spans the full width)
|
40 |
-
|
|
|
41 |
|
42 |
# Load the model (commented out, assuming model loading is handled elsewhere)
|
43 |
# classifier, absa, generator = load_model()
|
44 |
|
45 |
# Process the input text and generate output
|
46 |
if generate_button:
|
47 |
-
with
|
48 |
with st.spinner('Generating the tweet...'):
|
49 |
# Example placeholders for the generated outputs
|
50 |
time.sleep(5) # Simulating delay
|
|
|
13 |
|
14 |
|
15 |
# Container for ideology selection spanning across first two columns
|
16 |
+
col11, col12 = st.columns([6, 3]) # Adjust the ratios as needed for better appearance
|
17 |
+
col21, col22, col23 = st.columns([3, 3, 3]) # Adjust the ratios as needed for better appearance
|
18 |
+
with col11:
|
19 |
model_selection = st.selectbox(
|
20 |
"Select an ideology",
|
21 |
options=['Left', 'Right'],
|
|
|
23 |
)
|
24 |
|
25 |
# Layout for entities and aspects inputs
|
26 |
+
with col21:
|
27 |
st.header("Entities")
|
28 |
pro_entities = st.text_input("Pro Entities", help="Enter pro entities separated by commas")
|
29 |
anti_entities = st.text_input("Anti Entities", help="Enter anti entities separated by commas")
|
30 |
neutral_entities = st.text_input("Neutral Entities", help="Enter neutral entities separated by commas")
|
31 |
|
32 |
+
with col22:
|
|
|
|
|
33 |
st.header("Aspects")
|
34 |
pro_aspects = st.text_input("Pro Aspects", help="Enter pro aspects separated by commas")
|
35 |
anti_aspects = st.text_input("Anti Aspects", help="Enter anti aspects separated by commas")
|
36 |
neutral_aspects = st.text_input("Neutral Aspects", help="Enter neutral aspects separated by commas")
|
37 |
|
38 |
# Generate button (placed outside the columns so it spans the full width)
|
39 |
+
with col12:
|
40 |
+
generate_button = st.button("Generate tweet and classify toxicity")
|
41 |
|
42 |
# Load the model (commented out, assuming model loading is handled elsewhere)
|
43 |
# classifier, absa, generator = load_model()
|
44 |
|
45 |
# Process the input text and generate output
|
46 |
if generate_button:
|
47 |
+
with col23: # This block is for displaying outputs in the wider column
|
48 |
with st.spinner('Generating the tweet...'):
|
49 |
# Example placeholders for the generated outputs
|
50 |
time.sleep(5) # Simulating delay
|