Spaces:
Sleeping
Sleeping
File size: 715 Bytes
b50ad18 9c881b4 b50ad18 9c881b4 b50ad18 9c881b4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import gradio as gr
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
# Inizializza il modello e l'agente
search_tool = DuckDuckGoSearchTool()
model = HfApiModel()
agent = CodeAgent(model=model, tools=[search_tool])
# Funzione per analizzare le notizie
def detect_fake_news(news_text):
response = agent.run(f"Check if this news is true or fake: {news_text}")
return response
# Configurazione di Gradio
interface = gr.Interface(
fn=detect_fake_news,
inputs="text",
outputs="text",
title="🕵️ Fake News Detective",
description="Paste a news article or statement and get a credibility analysis."
)
# Avvio dell'app
if __name__ == "__main__":
interface.launch()
|