From 94da85702fcabf4f467a84a63701f75bfaacba0c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 Feb 2025 07:56:49 +0100 Subject: [PATCH] cambios menores --- app/routes.py | 1 - scrapper/iacorrector.py | 6 ------ 2 files changed, 7 deletions(-) diff --git a/app/routes.py b/app/routes.py index 7be187b..436c33f 100644 --- a/app/routes.py +++ b/app/routes.py @@ -34,7 +34,6 @@ def create_news_item(item: NewsItemCreate, db: Session = Depends(get_db)): existing_item = db.query(NewsItem).filter(NewsItem.titulo == item.titulo).first() if existing_item: logging.info("Título ya en la base de datos") - raise HTTPException(status_code=400, detail="El título ya existe en la base de datos") # Crear nuevo objeto new_item = NewsItem( diff --git a/scrapper/iacorrector.py b/scrapper/iacorrector.py index bf128ee..96f342d 100644 --- a/scrapper/iacorrector.py +++ b/scrapper/iacorrector.py @@ -16,7 +16,6 @@ OLLAMA_URL = os.environ.get("OLLAMA_URL", "http://host.docker.internal:11434/api OLLAMA_MODEL = os.environ.get("OLLAMA_MODEL", "llama3") def is_security_related(prompt): - logging.info(f"Checking if topic is security-related: {prompt}") data = { "model": OLLAMA_MODEL, "prompt": f"Does the following topic relate to national defense, armed forces, police, espionage, or intelligence? Answer only with 'true' or 'false'. Topic: {prompt}", @@ -30,7 +29,6 @@ def is_security_related(prompt): json_data = json.loads(line) if "response" in json_data and json_data["response"].strip(): result = json_data["response"].strip().lower() == "true" - logging.info(f"Result for '{prompt}': {result}") return result except requests.RequestException as e: @@ -41,7 +39,6 @@ def is_security_related(prompt): return False def is_critico(prompt): - logging.info(f"Checking if topic is critical of security forces: {prompt}") data = { "model": OLLAMA_MODEL, "prompt": f"Does the following text criticizes the armed forces, security forces as Guardia Civil or Police, intelligence agencies such as CNI? Answer only with 'true' or 'false'. Topic: {prompt}", @@ -55,7 +52,6 @@ def is_critico(prompt): json_data = json.loads(line) if "response" in json_data and json_data["response"].strip(): result = json_data["response"].strip().lower() == "true" - logging.info(f"Result for '{prompt}': {result}") return result except requests.RequestException as e: @@ -66,7 +62,6 @@ def is_critico(prompt): return False def is_favorable(prompt): - logging.info(f"Checking if topic is favorable to security forces: {prompt}") data = { "model": OLLAMA_MODEL, "prompt": f"Does the following text favor the armed forces, security forces as Guardia Civil or Police, intelligence agencies such as CNI? Answer only with 'true' or 'false'. Topic: {prompt}", @@ -80,7 +75,6 @@ def is_favorable(prompt): json_data = json.loads(line) if "response" in json_data and json_data["response"].strip(): result = json_data["response"].strip().lower() == "true" - logging.info(f"Result for '{prompt}': {result}") return result except requests.RequestException as e: