File size: 454 Bytes
292a188
 
7711e2d
 
292a188
7711e2d
 
f6734bb
292a188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import gradio as gr
from datasets import load_dataset


# Load the dataset
dataset = load_dataset("MohamedRashad/arabic-books")


# Function to display the first row text
def get_first_text():
    try:
        return dataset['train'][0]['text']
    except Exception as e:
        return str(e)


# Create a Gradio Interface
interface = gr.Interface(
    fn=get_first_text,
    inputs=[],
    outputs="text",
)

# Launch the interface
interface.launch()