Spaces:
Running
Running
Commit
·
df2ac1c
1
Parent(s):
95dc95a
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,19 @@
|
|
1 |
from functools import partial
|
2 |
from pathlib import Path
|
3 |
|
4 |
-
import kangas as kg
|
5 |
import streamlit as st
|
6 |
import streamlit.components.v1 as components
|
7 |
from datasets import load_dataset
|
|
|
8 |
|
9 |
proj_dir = Path(__file__).parent
|
10 |
|
|
|
|
|
|
|
11 |
servername = 'calebcometml-kangas-demo.hf.space'
|
12 |
-
src = f"https://{servername}:
|
13 |
|
14 |
st.set_page_config(layout="wide")
|
15 |
|
@@ -25,11 +29,11 @@ def kangas_fn(dataset_repo):
|
|
25 |
dg = kg.DataGrid(dataset)
|
26 |
with st.spinner("Saving Kangas..."):
|
27 |
dg.save(str(proj_dir / 'datagrids' / dg_file_name))
|
28 |
-
kg.show(
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
)
|
33 |
height = st.sidebar.slider("iFrame Height", 200, 1500, 900, 100)
|
34 |
scrolling = st.sidebar.checkbox("iFrame Scrolling")
|
35 |
|
|
|
1 |
from functools import partial
|
2 |
from pathlib import Path
|
3 |
|
4 |
+
#import kangas as kg
|
5 |
import streamlit as st
|
6 |
import streamlit.components.v1 as components
|
7 |
from datasets import load_dataset
|
8 |
+
import socket
|
9 |
|
10 |
proj_dir = Path(__file__).parent
|
11 |
|
12 |
+
hostname = socket.gethostname()
|
13 |
+
ip_address = socket.gethostbyname(hostname)
|
14 |
+
|
15 |
servername = 'calebcometml-kangas-demo.hf.space'
|
16 |
+
src = f"https://{servername}:80/kangas"
|
17 |
|
18 |
st.set_page_config(layout="wide")
|
19 |
|
|
|
29 |
dg = kg.DataGrid(dataset)
|
30 |
with st.spinner("Saving Kangas..."):
|
31 |
dg.save(str(proj_dir / 'datagrids' / dg_file_name))
|
32 |
+
#kg.show(
|
33 |
+
# port=7640,
|
34 |
+
# host=servername,
|
35 |
+
# protocol="https"
|
36 |
+
#)
|
37 |
height = st.sidebar.slider("iFrame Height", 200, 1500, 900, 100)
|
38 |
scrolling = st.sidebar.checkbox("iFrame Scrolling")
|
39 |
|