import gradio as gr model = gr.load("models/nicoco404/autotrain-aita-post-classifier-3535895495") title = "AITA Post Classifier" description = """Enter a post prompt to predict if You're The Asshole or not. \n What is AITA ? A catharsis for the frustrated moral philosopher in all of us, and a place to finally find out if you were wrong in an argument that's been bothering you. \n Check it out: https://www.reddit.com/r/AmItheAsshole/ \n\n You can also try to input the post title to check how misleading it's being. \n\n The model was trained on a 3k post dataset with a few hundred comments each to rate them. It can be found [here](https://huggingface.co/datasets/nicoco404/AITA_labeled_posts/raw/main/AITA_labeled_posts.csv). \n Check out our example post and the results yourselves on the [original post](https://www.reddit.com/r/AmItheAsshole/comments/131vkar/aita_for_refusing_to_eat_a_smash_cake/?utm_source=share&utm_medium=web2x&context=3) """ examples = [ """AITA for refusing to eat a "smash cake"?""", """Yesterday was my nephew's 1st birthday, and my sister and BIL had a little get together at their house. When it was time for cake, they brought out my nephew's "smash cake"—exactly what it sounds, a cake for the baby to smash up and get icing all over themselves for cute pictures or whatever. I kind of imagined that it would be the size of a big cupcake, but they brought out a regular-sized round birthday cake. I just kind of figured they splurged and still expected the cake to just be for him to play around with. BUT. After my nephew had gone at this cake with his bare hands, and stuck his whole face in it, my sister started scooping up the mangled remains and distributing servings to everyone (just a handful of family members.) And everyone else was actually eating it! I declined because...seriously? I didn't want to eat something that has had a baby's grubby hands and body all over it, and I was surprised that anyone else did. My sister insisted I take a portion and I said "Really, no, that's gross." Now...I probably wouldn't have used the word gross if I wasn't on the spot, but I was not at all prepared to have to politely decline to eat baby spit. My sister was very hurt by that and told me later (on a phone call that I thought was way longer than it needed to be for the severity of the infraction) that she thought I was being extremely judgemental, that it wasn't a big deal, we're all family, don't participate if I really don't want to but don't call her gross, etc. """] inputs = gr.inputs.Textbox(label="Post Prompt") outputs = gr.outputs.Label(label="Label") interface = gr.Interface(fn=model, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples) interface.launch()