File size: 495 Bytes
72dd3ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
import pandas as pd

def convert_parquet_to_jsonl(parquet_file):
    df = pd.read_parquet(parquet_file)
    jsonl_data = df.to_json(orient='records', lines=True)
    return jsonl_data

demo = gr.Interface(
    fn=convert_parquet_to_jsonl,
    inputs=[gr.File(label="Parquet File")],
    outputs=[gr.Textbox(label="JSONL Output")],
    title="Parquet to JSONL Converter",
    description="Convert a Parquet file to JSONL format"
)

if __name__ == "__main__":
    demo.launch()