Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import subprocess
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
def install_libraries():
|
| 7 |
try:
|
| 8 |
subprocess.check_call(['pip', 'install', 'pytube'])
|
|
@@ -37,22 +37,12 @@ def main():
|
|
| 37 |
start_index = st.session_state.get('start_index', 0)
|
| 38 |
end_index = start_index + 6
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
|
| 42 |
-
st.markdown(
|
| 43 |
-
"<table><tr><th class='timestamp'>Timestamp</th><th class='original'>Original</th></tr>",
|
| 44 |
-
unsafe_allow_html=True,
|
| 45 |
-
)
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
for i in range(start_index, min(end_index, len(captions_list))):
|
| 49 |
-
st.markdown(
|
| 50 |
-
f"<tr><td class='timestamp'>{captions_list[i]['Timestamp']}</td>"
|
| 51 |
-
f"<td class='original'>{captions_list[i]['Original']}</td></tr>",
|
| 52 |
-
unsafe_allow_html=True,
|
| 53 |
-
)
|
| 54 |
|
| 55 |
-
st.
|
|
|
|
|
|
|
| 56 |
|
| 57 |
# Larger previous button
|
| 58 |
col1, col2, col3 = st.columns([1, 8, 1])
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import subprocess
|
| 3 |
+
import pandas as pd # Import pandas for DataFrame manipulation
|
| 4 |
+
|
| 5 |
+
# Function to install libraries
|
| 6 |
def install_libraries():
|
| 7 |
try:
|
| 8 |
subprocess.check_call(['pip', 'install', 'pytube'])
|
|
|
|
| 37 |
start_index = st.session_state.get('start_index', 0)
|
| 38 |
end_index = start_index + 6
|
| 39 |
|
| 40 |
+
# Create DataFrame from captions_list
|
| 41 |
+
df = pd.DataFrame(captions_list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
# Display caption table with st.table
|
| 44 |
+
st.write("## Caption Table")
|
| 45 |
+
st.table(df[['Timestamp', 'Original']].iloc[start_index:end_index])
|
| 46 |
|
| 47 |
# Larger previous button
|
| 48 |
col1, col2, col3 = st.columns([1, 8, 1])
|