Spaces:
Sleeping
Sleeping
File size: 982 Bytes
937eac0 29e7240 937eac0 ab0de04 937eac0 ab0de04 937eac0 ab0de04 937eac0 ab0de04 937eac0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
"""Talk to spaces VM via subprocess.check_output."""
# pylint: disable=wrong-import-position
import sys
from pathlib import Path
if "." not in sys.path:
sys.path.insert(0, ".")
# import httpx
import subprocess as sp
from shlex import split
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
# from textwrap import dedent
from inspect import cleandoc
import gradio as gr
import logzero
from logzero import logger
# from gradiobee.seg_text import seg_text
matplotlib.use("Agg") # non-interactive for plt.savefig
sns.set()
sns.set_style("darkgrid")
logzero.loglevel() # default to 10
def fn():
df = pd.DataFrame(data={'x': [1, 2], 'y': [3, 4], "cos": [0.1, 0.5]})
return df, df.to_html()
iface = gr.Interface(
fn=fn,
outputs=["dataframe", "html"],
title="Test dataframe and html",
description="Test dataframe and html",
# layout="vertical",
)
iface.launch(share=False, debug=True)
# iface.launch() |