File size: 846 Bytes
a479e48 3dbaaa3 a479e48 7adfed6 3dbaaa3 a479e48 7adfed6 a479e48 7adfed6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
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()
|