Spaces:
Runtime error
Runtime error
Commit
·
e332268
1
Parent(s):
bfa58d3
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
from realtabformer import REaLTabFormer
|
|
|
|
| 4 |
|
| 5 |
rtf_model = REaLTabFormer(
|
| 6 |
model_type="tabular",
|
|
@@ -8,7 +9,8 @@ rtf_model = REaLTabFormer(
|
|
| 8 |
|
| 9 |
|
| 10 |
def generate_data(file):
|
| 11 |
-
|
|
|
|
| 12 |
rtf_model.fit(df)
|
| 13 |
# Generate synthetic data
|
| 14 |
samples = rtf_model.sample(n_samples=5)
|
|
@@ -111,7 +113,7 @@ with gr.Blocks(css = css) as demo:
|
|
| 111 |
# transcribe_audio_r = gr.Button('Transcribe')
|
| 112 |
|
| 113 |
with gr.Tab("Upload Data as File"):
|
| 114 |
-
data_input_u = gr.File(label = 'Upload Data File', file_types=["text", ".json", ".csv"])
|
| 115 |
generate_data_btn = gr.Button('Generate Synthetic Data')
|
| 116 |
|
| 117 |
with gr.Row():
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
from realtabformer import REaLTabFormer
|
| 4 |
+
from scipy.io import arff
|
| 5 |
|
| 6 |
rtf_model = REaLTabFormer(
|
| 7 |
model_type="tabular",
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def generate_data(file):
|
| 12 |
+
data = arff.loadarff(file)
|
| 13 |
+
df = pd.Dataframe(data[0])
|
| 14 |
rtf_model.fit(df)
|
| 15 |
# Generate synthetic data
|
| 16 |
samples = rtf_model.sample(n_samples=5)
|
|
|
|
| 113 |
# transcribe_audio_r = gr.Button('Transcribe')
|
| 114 |
|
| 115 |
with gr.Tab("Upload Data as File"):
|
| 116 |
+
data_input_u = gr.File(label = 'Upload Data File', file_types=["text", ".json", ".csv", ".arff"])
|
| 117 |
generate_data_btn = gr.Button('Generate Synthetic Data')
|
| 118 |
|
| 119 |
with gr.Row():
|