Abs6187 commited on
Commit
10d107e
·
verified ·
1 Parent(s): 7a02a84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -16
app.py CHANGED
@@ -129,29 +129,18 @@ def predict(image: Image.Image, text: str) -> str:
129
  )
130
  predicted_class = torch.sigmoid(classification_output).round().item()
131
 
132
- return "Fake News" if predicted_class == 1 else "Real News"
133
-
134
- # Custom Theme
135
- theme = gr.themes.Base(
136
- primary_hue="slate",
137
- secondary_hue="blue",
138
- neutral_hue="gray",
139
- text_size="lg",
140
- radius_size="md",
141
- font=["Roboto", "sans-serif"]
142
- )
143
 
144
  # Gradio Interface
145
  interface = gr.Interface(
146
  fn=predict,
147
  inputs=[
148
- gr.Image(type="pil", label="Upload Related Image"),
149
- gr.Textbox(lines=2, placeholder="Enter news text for classification...", label="Input Text")
150
  ],
151
  outputs=gr.Label(label="Prediction"),
152
- title="Fake News Detector",
153
- description="Upload an image and provide text to classify the news as 'Fake' or 'Real'.",
154
- theme=theme
155
  )
156
 
157
  interface.launch()
 
129
  )
130
  predicted_class = torch.sigmoid(classification_output).round().item()
131
 
132
+ return "Biased" if predicted_class == 1 else "Unbiased"
 
 
 
 
 
 
 
 
 
 
133
 
134
  # Gradio Interface
135
  interface = gr.Interface(
136
  fn=predict,
137
  inputs=[
138
+ gr.Image(type="pil", label="Upload Image"),
139
+ gr.Textbox(lines=2, placeholder="Enter text for classification...", label="Input Text")
140
  ],
141
  outputs=gr.Label(label="Prediction"),
142
+ title="Multimodal Bias Classifier",
143
+ description="Upload an image and provide a text to classify it as 'Biased' or 'Unbiased'."
 
144
  )
145
 
146
  interface.launch()