import gradio as gr from transformers import pipeline # Handle calls to DistilBERT no LORA distilBERTnoLORA_pipe = pipeline(model="Intradiction/text_classification_NoLORA") def distilBERTnoLORA_fn(text): return distilBERTnoLORA_pipe(text) def chat1(message,history): history = history or [] message = message.lower() if message.startswith("how many"): response = ("1 to 10") else: response = ("whatever man whatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever manwhatever man") history.append((message, response)) return history, history chatbot = gr.Chatbot() chatbot1 = gr.Chatbot() chatbot2 = gr.Chatbot() with gr.Blocks( title="", ) as demo: gr.Markdown("""
""") with gr.Tab("Text Classification"): with gr.Row(): gr.Markdown("Model: Tiny Bert
Dataset: IMDB Movie review dataset
NLP Task: Text Classification
I don’t know why but I just enjoy doing this. Maybe it’s my way of dealing with stress or something but I just do it about once every week. Generally I’ll carry around a sack and creep around in a sort of crouch-walking position making goblin noises, then I’ll walk around my house and pick up various different “trinkets” and put them in my bag while saying stuff like “I’ll be having that” and laughing maniacally in my goblin voice (“trinkets” can include anything from stuff I find on the ground to cutlery or other utensils). The other day I was talking with my neighbours and they mentioned hearing weird noises like what I wrote about and I was just internally screaming the entire conversation.
""") with gr.Column(scale=0.3,variant="panel"): inp = gr.Textbox(placeholder="Prompt",label= "Enter Query") btn = gr.Button("Run") gr.Examples( [ "I thought this was a bit contrived", "You would need to be a child to enjoy this", "Drive more like Drive away", ], inp, label="Try asking", ) with gr.Column(): with gr.Row(variant="panel"): out = gr.Textbox(label= " Untrained Model") gr.Markdown("""Model: ELECTRA Bert Small
Dataset: Stanford Natural Language Inference Dataset
NLP Task: Natual Languae Infrencing
insert information on training parameters here
""") with gr.Column(scale=0.3,variant="panel"): inp = gr.Textbox(placeholder="Prompt",label= "Enter Query") btn = gr.Button("Run") gr.Examples( [ "I thought this was a bit contrived", "You would need to be a child to enjoy this", "Drive more like Drive away", ], inp, label="Try asking", ) with gr.Column(): with gr.Row(variant="panel"): out = gr.Textbox(label= " Untrained Model") gr.Markdown("""Model: DeBERTa-v3-xsmall
Dataset: Quora Question Pairs dataset
NLP Task: Semantic Text Similarity
insert information on training parameters here
""") with gr.Column(scale=0.3,variant="panel"): inp = gr.Textbox(placeholder="Prompt",label= "Enter Query") btn = gr.Button("Run") gr.Examples( [ "I thought this was a bit contrived", "You would need to be a child to enjoy this", "Drive more like Drive away", ], inp, label="Try asking", ) with gr.Column(): with gr.Row(variant="panel"): out = gr.Textbox(label= " Untrained Model") gr.Markdown("""