Moiz
added slider styles
1c16e20
raw
history blame
747 Bytes
import gradio as gr
# Function to handle movie rating
def rate_movie(movie_name, rating):
if rating == "N/A":
return f"You haven't watched '{movie_name}' yet."
else:
return f"You rated '{movie_name}' a {rating}/10."
# Gradio interface
with gr.Blocks(css="styles.css") as app:
gr.Markdown("# Movie Rating App")
movie_name = gr.Textbox(label="Movie Name", placeholder="Enter the movie name...")
rating = gr.Slider(
minimum=0,
maximum=10,
step=0.25,
elem_id="custom-slider" # Add a custom ID
)
submit = gr.Button("Submit Rating")
output = gr.Textbox(label="Your Feedback")
submit.click(rate_movie, inputs=[movie_name, rating], outputs=output)
app.launch()