hertogateis commited on
Commit
74b544f
·
verified ·
1 Parent(s): b1f875b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -15
app.py CHANGED
@@ -4,29 +4,47 @@ from st_aggrid import AgGrid
4
  import pandas as pd
5
  from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
6
 
7
- # Set the page layout for Streamlit
8
- st.set_page_config(layout="wide")
9
 
10
- # CSS styling
11
  style = '''
12
  <style>
13
- body {background-color: #F5F5F5; color: #000000;}
14
- header {visibility: hidden;}
15
- div.block-container {padding-top:4rem;}
16
- section[data-testid="stSidebar"] div:first-child {
17
- padding-top: 0;
18
- }
19
- .font {
20
- text-align:center;
21
- font-family:sans-serif;font-size: 1.25rem;}
 
 
 
 
 
 
 
 
 
 
 
22
  </style>
23
  '''
 
 
24
  st.markdown(style, unsafe_allow_html=True)
25
 
 
 
 
 
 
 
26
  st.markdown('<p style="font-family:sans-serif;font-size: 1.9rem;"> HertogAI Table Q&A using TAPAS+Data Analysis and Model Language</p>', unsafe_allow_html=True)
27
- st.markdown('<p style="font-family:sans-serif;font-size: 1.9rem;"> This code is based on Jordan Skinner. I recoded and enhanced for </p>', unsafe_allow_html=True)
28
- st.markdown('<p style="font-family:sans-serif;font-size: 1.9rem;"> the Data analisys are (SUM, MAX, MIN, AVG, COUNT, MEAN, STDDEV) </p>', unsafe_allow_html=True)
29
- st.markdown("<p style='font-family:sans-serif;font-size: 0.9rem;'>Pre-trained TAPAS model runs on max 64 rows and 32 columns data. Make sure the file data doesn't exceed these dimensions.</p>", unsafe_allow_html=True)
30
 
31
  # Initialize TAPAS pipeline
32
  tqa = pipeline(task="table-question-answering",
 
4
  import pandas as pd
5
  from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
6
 
7
+ import streamlit as st
 
8
 
9
+ # CSS styling for the toggle button and instructions
10
  style = '''
11
  <style>
12
+ .toggle-wrapper {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ padding: 10px;
17
+ background-color: #f0f0f0;
18
+ border-radius: 10px;
19
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
20
+ margin-top: 20px;
21
+ }
22
+ .toggle-text {
23
+ font-family: sans-serif;
24
+ font-size: 1.2rem;
25
+ margin-right: 10px;
26
+ }
27
+ .slide-to-enter {
28
+ font-size: 1rem;
29
+ font-family: sans-serif;
30
+ color: #333;
31
+ }
32
  </style>
33
  '''
34
+
35
+ # Include the CSS to the page
36
  st.markdown(style, unsafe_allow_html=True)
37
 
38
+ # Render the toggle button with "Slide to enter data" text
39
+ st.markdown('<div class="toggle-wrapper"><span class="toggle-text">> </span><span class="slide-to-enter">Slide to enter data</span></div>', unsafe_allow_html=True)
40
+
41
+ # Your main app content goes here
42
+
43
+
44
  st.markdown('<p style="font-family:sans-serif;font-size: 1.9rem;"> HertogAI Table Q&A using TAPAS+Data Analysis and Model Language</p>', unsafe_allow_html=True)
45
+ st.markdown('<p style="font-family:sans-serif;font-size: 0.9rem;"> This code is based on Jordan Skinner. I recoded and enhanced for </p>', unsafe_allow_html=True)
46
+ st.markdown('<p style="font-family:sans-serif;font-size: 0.9rem;"> the Data analisys are (SUM, MAX, MIN, AVG, COUNT, MEAN, STDDEV) </p>', unsafe_allow_html=True)
47
+ st.markdown("<p style='font-family:sans-serif;font-size: 0.5rem;'>Pre-trained TAPAS model runs on max 64 rows and 32 columns data. Make sure the file data doesn't exceed these dimensions.</p>", unsafe_allow_html=True)
48
 
49
  # Initialize TAPAS pipeline
50
  tqa = pipeline(task="table-question-answering",