import pandas as pd import gradio as gr from transformers import pipeline # URL of the CSV file csv_url = "https://huggingface.co/spaces/kataniccc/tekst/blob/main/submission.csv" # Read the CSV file into a pandas DataFrame df = pd.read_csv(csv_url) # Load the model for text classification model_nm = 'microsoft/deberta-v3-small' classifier = pipeline("text-classification", model=model_nm) # Define prediction function def predict_text(input_text): prediction = classifier(input_text) return prediction # Define Gradio interface text_input = gr.inputs.Textbox(lines=7, label="Unesite tekst") output_text = gr.outputs.Textbox(label="Predikcija") gr.Interface(predict_text, inputs=text_input, outputs=output_text).launch()