import gradio as gr def predict(payload, payload_label): inputs = tokenizer(test_payload, return_tensors="tf") model = TFAutoModelForSequenceClassification.from_pretrained("models/ankush-003/nosqli_identifier") logits = model(**inputs).logits predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0]) # print(model.config.id2label[predicted_class_id]) return model.config.id2label[predicted_class_id] # return "Fuck You" demo = gr.Interface( fn=predict, inputs=["text","checkbox"], outputs="text", ) demo.launch(debug=True) # gr.Interface.load("models/ankush-003/nosqli_identifier").launch()