import gradio as gr from transformers import pipeline pipe = pipeline("text-classification", model="1231czx/llama3_it_ultra_list_and_bold500") def classify_text(text): result = pipe(text) return result[0]['label'], result[0]['score'] # Gradio interface setup title = "Custom Model Text Classification" description = "Provide a block of text, and the custom LLaMA-based model will classify it." # Create Gradio interface interface = gr.Interface( fn=classify_text, inputs=gr.Textbox(label="Input Text"), outputs=[gr.Textbox(label="Predicted Label"), gr.Number(label="Confidence Score")], title=title, description=description, ) # Launch the Gradio app if __name__ == "__main__": interface.launch()