bvishnu123's picture
Update app.py
3dbaaa3 verified
raw
history blame
846 Bytes
import gradio as gr
from fake_job_detector.models import DistilBERTBaseModel
def process_input(title, description):
# Load the safetensors
safetensors_path = "base_unfrozen_5epoch"
# Load the DistilBERT model
model = DistilBERTBaseModel(safetensors_path)
result = model(title, description)
return result
def main():
# Define the interface
interface = gr.Interface(
fn=process_input, # the function to process input
inputs=[gr.Textbox(label="Title"), gr.Textbox(label="Description", lines=4)], # input fields
outputs=gr.Textbox(label="Output"), # output field
title="Simple Gradio App",
description="This is a simple Gradio app that concatenates title and description."
)
# Launch the interface
interface.launch()
if __name__ == "__main__":
main()