Spaces:
Sleeping
Sleeping
Update app.py
Browse files14 unmodified lines1516171819201 unmodified line2223242526272814 unmodified linespredicted_class = torch.argmax(logits, dim=-1).item() # Get the predicted classlabels = ["Negative", "Neutral", "Positive"] # Adjust based on your model's labelsreturn labels[predicted_class]# Set up Gradio interfaceinterface = gr.Interface(1 unmodified lineinputs=gr.Textbox(lines=2, placeholder="Enter text to classify..."),outputs=gr.Textbox(label="Predicted Sentiment"),title="Sentiment Classifier",description="Enter a piece of text and let the model classify it as Negative, Neutral, or Positive.")# Launch the app14 unmodified lines15161718192021222324252627281 unmodified line3031323334353614 unmodified linespredicted_class = torch.argmax(logits, dim=-1).item() # Get the predicted classlabels = ["Negative", "Neutral", "Positive"] # Adjust based on your model's labelsreturn labels[predicted_class]css =body {background-image: url('https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.cardekho.com%2Fkia%2Fcarnival&psig=AOvVaw0gJ-OuvTNRMOejPCpZbXvN&ust=1733533986628000&source=images&cd=vfe&opi=89978449&ved=0CBQQjRxqFwoTCPDU4sP7kYoDFQAAAAAdAAAAABAE'); /* Replace with your image URL */background-size: cover;background-repeat: no-repeat;background-attachment: fixed;}# Set up Gradio interfaceinterface = gr.Interface(1 unmodified lineinputs=gr.Textbox(lines=2, placeholder="Enter text to classify..."),outputs=gr.Textbox(label="Predicted Sentiment"),title="Sentiment Classifier",description="Enter a piece of car review and let the model classify it as Negative, Neutral, or Positive.")# Launch the app
app.py+9-1