File size: 1,036 Bytes
b248545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from transformers import pipeline

# Load Hugging Face model
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")

# Function to process input
def analyze_rbo_text(input_text):
    if not input_text.strip():
        return "Please enter a valid RBO game description or video link."
    
    # AI-generated summary
    summary = summarizer(input_text, max_length=100, min_length=30, do_sample=False)
    return summary[0]['summary_text']

# Create Gradio UI
with gr.Blocks() as app:
    gr.Markdown("# 🎮 Plays RBO Games or Videos")
    gr.Markdown("Enter a Roblox game description or video link, and AI will summarize it!")

    with gr.Row():
        input_text = gr.Textbox(placeholder="Enter game description or video link...", lines=4)
        output_text = gr.Textbox(label="AI Summary", interactive=False)

    submit_button = gr.Button("Analyze")

    submit_button.click(analyze_rbo_text, inputs=input_text, outputs=output_text)

# Launch app
if __name__ == "__main__":
    app.launch()