Frontend_test / app.py
Th3r0's picture
Update app.py
61357d4 verified
raw
history blame
No virus
4.66 kB
import gradio as gr
def chat1(message,history):
history = history or []
message = message.lower()
if message.startswith("how many"):
response = ("1 to 10")
else:
response = ("whatever 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("""
<div style="overflow: hidden;color:#fff;display: flex;flex-direction: column;align-items: center; position: relative; width: 100%; height: 180px;background-size: cover; background-image: url(https://www.grssigns.co.uk/wp-content/uploads/web-Header-Background.jpg);">
<img style="width: 130px;height: 60px;position: absolute;top:10px;left:10px" src="https://www.torontomu.ca/content/dam/tmumobile/images/TMU-Mobile-AppIcon.png"/>
<span style="margin-top: 40px;font-size: 36px ;font-family:fantasy;">Efficient Fine tuning Of Large Language Models</span>
<span style="margin-top: 10px;font-size: 14px;">By: Rahul Adams, Gerylyn Gao, Rajevan Lograjh & Mahir Faisal</span>
<span style="margin-top: 5px;font-size: 14px;">Group Id: AR06 FLC: Alice Reuada</span>
</div>
""")
with gr.Tab("Text Classification"):
with gr.Row():
gr.Markdown("<h1>Efficient Fine Tuning for Text Classification</h1>")
with gr.Row():
with gr.Column(scale=0.3):
inp = gr.Textbox(placeholder="Prompt",label= "Enter Query")
btn = gr.Button("Run")
gr.Markdown("""
<p>Model: Tiny Bert <br>
NLP Task: Text Classification <br>
Dataset: IMDB Movie review dataset for sentiment analysis</p>
<p>insert information on training parameters here</p>
""")
with gr.Row():
with gr.Column():
out = gr.Textbox(label= " Untrained Model")
with gr.Column():
out1 = gr.Textbox(label= " Conventionaly Fine Tuned Model")
with gr.Column():
out2 = gr.Textbox(label= " LoRA fine Tuned Model")
btn.click(fn=chat1, inputs=inp, outputs=out)
btn.click(fn=chat1, inputs=inp, outputs=out1)
btn.click(fn=chat1, inputs=inp, outputs=out2)
with gr.Tab("Natrual Language Infrencing"):
with gr.Row():
gr.Markdown("<h1>Efficient Fine Tuning for Natual Languae Infrencing</h1>")
with gr.Row():
with gr.Column(scale=0.3):
inp = gr.Textbox(placeholder="Prompt",label= "Enter Query")
btn = gr.Button("Run")
gr.Markdown("""
<p>Model: ELECTRA Bert Small <br>
NLP Task: Natual Languae Infrencing <br>
Dataset: Stanford Natural Language Inference Dataset</p>
<p>insert information on training parameters here</p>
""")
with gr.Row():
with gr.Column():
out = gr.Textbox(label= " Untrained Model")
with gr.Column():
out1 = gr.Textbox(label= " Conventionaly Fine Tuned Model")
with gr.Column():
out2 = gr.Textbox(label= " LoRA fine Tuned Model")
with gr.Tab("Sematic Text Similarity"):
with gr.Row():
gr.Markdown("<h1>Efficient Fine Tuning for Semantic Text Similarity</h1>")
with gr.Row():
with gr.Column(scale=0.3):
inp = gr.Textbox(placeholder="Prompt",label= "Enter Query")
btn = gr.Button("Run")
gr.Markdown("""
<p>Model: Tiny Bert <br>
NLP Task: Text Classification <br>
Dataset: IMDB Movie review dataset for sentiment analysis</p>
<p>insert information on training parameters here</p>
""")
with gr.Row():
with gr.Column():
out = gr.Textbox(label= " Untrained Model")
with gr.Column():
out1 = gr.Textbox(label= " Conventionaly Fine Tuned Model")
with gr.Column():
out2 = gr.Textbox(label= " LoRA fine Tuned Model")
with gr.Tab("More information"):
gr.Markdown("stuff to add")
if __name__ == "__main__":
demo.launch()