Spaces:
Sleeping
Sleeping
| 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() | |