Spaces:
Runtime error
Runtime error
| import json | |
| import os | |
| import random | |
| import gradio as gr | |
| import huggingface_hub | |
| from filelock import FileLock | |
| from markdown import GUIDELINES,HEADER | |
| os.makedirs("downloaded_data/data/train", exist_ok=True) | |
| os.makedirs("downloaded_data/data/validation", exist_ok=True) | |
| os.makedirs("downloaded_data/data/test", exist_ok=True) | |
| def html_progress_bar(split: str): | |
| if split == "0": | |
| percentage = 0 | |
| elif split == "100": | |
| percentage = 100 | |
| else: | |
| total = 0 | |
| annotations = 0 | |
| dataset_dir = os.path.join("downloaded_data/data", split) | |
| for filename in os.listdir(dataset_dir): | |
| if not filename.endswith(".json"): | |
| continue | |
| with open(os.path.join(dataset_dir, filename), "r", encoding="utf8") as file: | |
| data = json.load(file) | |
| n = len(data["results"]["generalScore"]) | |
| total += 2 | |
| if n == 1: | |
| annotations += 1 | |
| if n > 1: | |
| annotations += 2 | |
| if total == 0: | |
| percentage = 100 | |
| else: | |
| percentage = (annotations / total) * 100 | |
| return f""" | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Progress Bar</title> | |
| <style> | |
| .progress-container {{ | |
| width: 100%; | |
| background-color: #ffffff; | |
| }} | |
| .progress-bar {{ | |
| width: {percentage}%; | |
| height: 30px; | |
| background-color: #d1fae5; | |
| text-align: center; | |
| line-height: 30px; | |
| color: white; | |
| }} | |
| </style> | |
| </head> | |
| <body> | |
| <div class="progress-container"> | |
| <div class="progress-bar">{percentage:.0f}%</div> | |
| </div> | |
| </body> | |
| </html> | |
| """ | |
| class ExampleGetter: | |
| def __init__(self): | |
| # Download data from the Hugging Face Hub | |
| huggingface_hub.snapshot_download( | |
| "Iker/ClickbaitDetectorData", | |
| repo_type="dataset", | |
| token=os.environ.get("TOKEN") or True, | |
| local_dir="./downloaded_data", | |
| ) | |
| def get_example(self, split: str): | |
| if split not in ["train", "validation", "test"]: | |
| raise ValueError( | |
| f"split must be one of 'train','validation','test'. Got {split}" | |
| ) | |
| # Iterate over the dataset | |
| dataset_dir = os.path.join("downloaded_data/data", split) | |
| # Iterate over all json files in the directory | |
| results_dictionary = {} | |
| for filename in os.listdir(dataset_dir): | |
| if not filename.endswith(".json"): | |
| continue | |
| with open(os.path.join(dataset_dir, filename)) as file: | |
| data = json.load(file) | |
| n = len(data["results"]["generalScore"]) | |
| if n in results_dictionary: | |
| results_dictionary[n].append(filename) | |
| else: | |
| results_dictionary[n] = [filename] | |
| if len(results_dictionary) == 0: | |
| return ( | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| ) | |
| # Get a random example | |
| min_n = min(results_dictionary.keys()) | |
| examples = results_dictionary[min_n] | |
| choosen_file = random.choice(examples) | |
| choosen_file = os.path.join(dataset_dir, choosen_file) | |
| with open(choosen_file, "r", encoding="utf8") as file: | |
| data = json.load(file) | |
| return ( | |
| choosen_file, | |
| data["title"], | |
| data["content"], | |
| data["gpt_title"], | |
| data["gpt_summary"], | |
| ) | |
| def update_example( | |
| self, | |
| file_name: str, | |
| exageracion: int, | |
| discrepancia: int, | |
| promesas: int, | |
| incompleto: int, | |
| urgencia: int, | |
| sensacionalismo: int, | |
| manipulacion: int, | |
| contexto: int, | |
| generalScore: int, | |
| summary: str, | |
| title: str, | |
| ): | |
| if file_name == "Pulsa ▶️": | |
| return ( | |
| html_progress_bar("0"), | |
| "Pulsa ▶️", | |
| "Pulsa ▶️", | |
| "Pulsa ▶️", | |
| "Pulsa ▶️", | |
| "Pulsa ▶️", | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| ) | |
| if file_name == "No hay ejemplos disponibles para anotar": | |
| return ( | |
| html_progress_bar("100"), | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| "No hay ejemplos disponibles para anotar", | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| ) | |
| # Update the example with the new scores | |
| split = file_name.split("/")[2] | |
| file_path = file_name | |
| # Filelock | |
| with FileLock(file_path + ".lock"): | |
| with open(file_path, "r", encoding="utf8") as file: | |
| data = json.load(file) | |
| data["gpt_summary"] = summary | |
| data["gpt_title"] = title | |
| data["results"]["exageracion"].append(exageracion) | |
| data["results"]["discrepancia"].append(discrepancia) | |
| data["results"]["promesas"].append(promesas) | |
| data["results"]["incompleto"].append(incompleto) | |
| data["results"]["urgencia"].append(urgencia) | |
| data["results"]["sensacionalismo"].append(sensacionalismo) | |
| data["results"]["contexto"].append(contexto) | |
| data["results"]["manipulacion"].append(manipulacion) | |
| data["results"]["generalScore"].append(generalScore) | |
| with open(file_path, "w", encoding="utf8") as file: | |
| json.dump(data, file, indent=4, ensure_ascii=False) | |
| # Update the example in the hub | |
| huggingface_hub.upload_file( | |
| repo_id="Iker/ClickbaitDetectorData", | |
| repo_type="dataset", | |
| token=os.environ.get("TOKEN") or True, | |
| path_in_repo="/".join(file_path.split("/")[1:]), | |
| path_or_fileobj=file_path, | |
| ) | |
| file_name, title, content, gpt_title, gpt_summary = self.get_example(split) | |
| return ( | |
| html_progress_bar(split), | |
| file_name, | |
| title, | |
| content, | |
| gpt_title, | |
| gpt_summary, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| ) | |
| def start_train(self): | |
| file_name, title, content, gpt_title, gpt_summary = self.get_example("train") | |
| return ( | |
| html_progress_bar("train"), | |
| file_name, | |
| title, | |
| content, | |
| gpt_title, | |
| gpt_summary, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| ) | |
| def start_validation(self): | |
| file_name, title, content, gpt_title, gpt_summary = self.get_example( | |
| "validation" | |
| ) | |
| return ( | |
| html_progress_bar("validation"), | |
| file_name, | |
| title, | |
| content, | |
| gpt_title, | |
| gpt_summary, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| ) | |
| def start_test(self): | |
| file_name, title, content, gpt_title, gpt_summary = self.get_example("test") | |
| return ( | |
| html_progress_bar("test"), | |
| file_name, | |
| title, | |
| content, | |
| gpt_title, | |
| gpt_summary, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| ) | |
| example_getter = ExampleGetter() | |
| theme = gr.themes.Soft( | |
| primary_hue="emerald", | |
| secondary_hue="cyan", | |
| text_size="md", | |
| spacing_size="lg", | |
| font=[ | |
| gr.themes.GoogleFont("Poppins"), | |
| gr.themes.GoogleFont("Poppins"), | |
| gr.themes.GoogleFont("Poppins"), | |
| gr.themes.GoogleFont("Poppins"), | |
| ], | |
| ).set( | |
| block_background_fill="*neutral_50", | |
| block_background_fill_dark="*neutral_950", | |
| section_header_text_size="*text_lg", | |
| section_header_text_weight="800", | |
| ) | |
| file_name = "Pulsa ▶️" | |
| title = "Pulsa ▶️" | |
| content = "Pulsa ▶️" | |
| gpt_title = "Pulsa ▶️" | |
| gpt_summary = "Pulsa ▶️" | |
| with gr.Blocks( | |
| theme=theme, | |
| title="🖱️ Anotación de Clickbait", | |
| analytics_enabled=False, | |
| fill_height=True, | |
| ) as demo: | |
| gr.Markdown(HEADER) | |
| with gr.Tab("Guidelines de anotación") as tab_guidelines: | |
| gr.Markdown(GUIDELINES) | |
| with gr.Tab("Train") as tab_progress: | |
| gr_play = gr.Button("▶️ Empieza a anotar") | |
| gr_filename = gr.Textbox( | |
| label="Nombre del archivo", | |
| value=file_name, | |
| lines=1, | |
| interactive=False, | |
| visible=True, | |
| ) | |
| gr_progress = gr.HTML(value=html_progress_bar("train"), label="Progreso") | |
| gr_title = gr.Textbox(label="Título", value=title, lines=1, interactive=False) | |
| gr_title_gpt = gr.Textbox( | |
| label="Título GPT", value=gpt_title, lines=1, interactive=True | |
| ) | |
| gr_summary = gr.Textbox( | |
| label="Resumen GPT", value=gpt_summary, lines=4, interactive=True | |
| ) | |
| with gr.Accordion("Ver texto completo", open=False): | |
| gr_content = gr.Textbox( | |
| label="Contenido", | |
| lines=15, | |
| value=content, | |
| interactive=False, | |
| ) | |
| gr_exageracion = gr.Slider( | |
| label="Exageración", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se identifica y evalua el uso de afirmaciones excesivas o superlativas que pueden distorsionar la realidad del contenido ofrecido.", | |
| ) | |
| gr_contexto = gr.Slider( | |
| label="Omisión de Contexto", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se revela la falta de información contextual que es esencial para entender completamente la noticia o el argumento presentado.", | |
| ) | |
| gr_urgencia = gr.Slider( | |
| label="Urgencia Artificial", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se evalua el uso de frases que intentan crear una percepción de necesidad inmediata o limitación temporal sin justificación real.", | |
| ) | |
| gr_sensacionalismo = gr.Slider( | |
| label="Sensacionalismo", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se distingue el contenido que busca impactar emocionalmente al lector mediante el uso de afirmaciones alarmantes o escandalosas sin fundamento sólido.", | |
| ) | |
| gr_manipulacion = gr.Radio( | |
| label="Influencia", | |
| choices=[("No se usan técnicas de manipulación",-1),("Se usan técnicas de manipulación",5)], | |
| info="Se analizan las técnicas utilizadas para influir en la percepción del lector o dirigir sus conclusiones de manera sesgada o con fines específicos.", | |
| ) | |
| gr_discrepancia = gr.Radio( | |
| label="Discrepancia Título-Contenido", | |
| choices=[("No hay discrepancia",-5),("Existe discrepancia",10)], | |
| info="Se evalua la coherencia entre los titulares y el cuerpo del artículo, asegurando que las expectativas generadas se cumplan efectivamente.", | |
| ) | |
| gr_promesas = gr.Radio( | |
| label="Promesas Incumplidas", | |
| choices=[("No hay promesas incumplidas",-1),("Hay promesas incumplidas",5)], | |
| info="Se detecta cuando los titulares hacen promesas específicas que el contenido no logra satisfacer, manteniendo un estándar de integridad informativa.", | |
| ) | |
| gr_incompleto = gr.Radio( | |
| label="Información Incompleta", | |
| choices=[("La información es completa",-1),("La información es incompleta",5)], | |
| info="Se identifica la omisión de detalles cruciales que son necesarios para una comprensión completa del tema, evitando tácticas que buscan meramente incentivar clics.", | |
| ) | |
| gr_generalScore = gr.Slider( | |
| label="Clasificación General", | |
| minimum=0, | |
| maximum=100, | |
| value=0, | |
| info="Clasificación general del nivel de clickbait del artículo en una escala del 0 al 100, donde 0 significa que el artículo no es clickbait y 100 significa que el artículo es clickbait en su máxima expresión.", | |
| ) | |
| save = gr.Button("💾 Enviar") | |
| gr_play.click( | |
| fn=example_getter.start_train, | |
| outputs=[ | |
| gr_progress, | |
| gr_filename, | |
| gr_title, | |
| gr_content, | |
| gr_title_gpt, | |
| gr_summary, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| ], | |
| ) | |
| save.click( | |
| fn=example_getter.update_example, | |
| inputs=[ | |
| gr_filename, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| gr_summary, | |
| gr_title, | |
| ], | |
| outputs=[ | |
| gr_progress, | |
| gr_filename, | |
| gr_title, | |
| gr_content, | |
| gr_title_gpt, | |
| gr_summary, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| ], | |
| ) | |
| with gr.Tab("Validation") as tab_progress: | |
| gr_play = gr.Button("▶️ Empieza a anotar") | |
| gr_filename = gr.Textbox( | |
| label="Nombre del archivo", | |
| value=file_name, | |
| lines=1, | |
| interactive=False, | |
| visible=True, | |
| ) | |
| gr_progress = gr.HTML(value=html_progress_bar("validation"), label="Progreso") | |
| gr_title = gr.Textbox(label="Título", value=title, lines=1, interactive=False) | |
| gr_title_gpt = gr.Textbox( | |
| label="Título GPT", value=gpt_title, lines=1, interactive=True | |
| ) | |
| gr_summary = gr.Textbox( | |
| label="Resumen GPT", value=gpt_summary, lines=4, interactive=True | |
| ) | |
| with gr.Accordion("Ver texto completo", open=False): | |
| gr_content = gr.Textbox( | |
| label="Contenido", | |
| lines=15, | |
| value=content, | |
| interactive=False, | |
| ) | |
| gr_exageracion = gr.Slider( | |
| label="Exageración", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se identifica y evalua el uso de afirmaciones excesivas o superlativas que pueden distorsionar la realidad del contenido ofrecido.", | |
| ) | |
| gr_contexto = gr.Slider( | |
| label="Omisión de Contexto", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se revela la falta de información contextual que es esencial para entender completamente la noticia o el argumento presentado.", | |
| ) | |
| gr_urgencia = gr.Slider( | |
| label="Urgencia Artificial", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se evalua el uso de frases que intentan crear una percepción de necesidad inmediata o limitación temporal sin justificación real.", | |
| ) | |
| gr_sensacionalismo = gr.Slider( | |
| label="Sensacionalismo", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se distingue el contenido que busca impactar emocionalmente al lector mediante el uso de afirmaciones alarmantes o escandalosas sin fundamento sólido.", | |
| ) | |
| gr_manipulacion = gr.Radio( | |
| label="Influencia", | |
| choices=[("No se usan técnicas de manipulación",-1),("Se usan técnicas de manipulación",5)], | |
| info="Se analizan las técnicas utilizadas para influir en la percepción del lector o dirigir sus conclusiones de manera sesgada o con fines específicos.", | |
| ) | |
| gr_discrepancia = gr.Radio( | |
| label="Discrepancia Título-Contenido", | |
| choices=[("No hay discrepancia",-5),("Existe discrepancia",10)], | |
| info="Se evalua la coherencia entre los titulares y el cuerpo del artículo, asegurando que las expectativas generadas se cumplan efectivamente.", | |
| ) | |
| gr_promesas = gr.Radio( | |
| label="Promesas Incumplidas", | |
| choices=[("No hay promesas incumplidas",-1),("Hay promesas incumplidas",5)], | |
| info="Se detecta cuando los titulares hacen promesas específicas que el contenido no logra satisfacer, manteniendo un estándar de integridad informativa.", | |
| ) | |
| gr_incompleto = gr.Radio( | |
| label="Información Incompleta", | |
| choices=[("La información es completa",-1),("La información es incompleta",5)], | |
| info="Se identifica la omisión de detalles cruciales que son necesarios para una comprensión completa del tema, evitando tácticas que buscan meramente incentivar clics.", | |
| ) | |
| gr_generalScore = gr.Slider( | |
| label="Clasificación General", | |
| minimum=0, | |
| maximum=100, | |
| value=0, | |
| info="Clasificación general del nivel de clickbait del artículo en una escala del 0 al 100, donde 0 significa que el artículo no es clickbait y 100 significa que el artículo es clickbait en su máxima expresión.", | |
| ) | |
| save = gr.Button("💾 Enviar") | |
| save.click( | |
| fn=example_getter.update_example, | |
| inputs=[ | |
| gr_filename, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| gr_summary, | |
| gr_title, | |
| ], | |
| outputs=[ | |
| gr_progress, | |
| gr_filename, | |
| gr_title, | |
| gr_content, | |
| gr_title_gpt, | |
| gr_summary, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| ], | |
| ) | |
| gr_play.click( | |
| fn=example_getter.start_validation, | |
| outputs=[ | |
| gr_progress, | |
| gr_filename, | |
| gr_title, | |
| gr_content, | |
| gr_title_gpt, | |
| gr_summary, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| ], | |
| ) | |
| with gr.Tab("Test") as tab_progress: | |
| gr_play = gr.Button("▶️ Empieza a anotar") | |
| gr_filename = gr.Textbox( | |
| label="Nombre del archivo", | |
| value=file_name, | |
| lines=1, | |
| interactive=False, | |
| visible=True, | |
| ) | |
| gr_progress = gr.HTML(value=html_progress_bar("test"), label="Progreso") | |
| gr_title = gr.Textbox(label="Título", value=title, lines=1, interactive=False) | |
| gr_title_gpt = gr.Textbox( | |
| label="Título GPT", value=gpt_title, lines=1, interactive=True | |
| ) | |
| gr_summary = gr.Textbox( | |
| label="Resumen GPT", value=gpt_summary, lines=4, interactive=True | |
| ) | |
| with gr.Accordion("Ver texto completo", open=False): | |
| gr_content = gr.Textbox( | |
| label="Contenido", | |
| lines=15, | |
| value=content, | |
| interactive=False, | |
| ) | |
| gr_exageracion = gr.Slider( | |
| label="Exageración", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se identifica y evalua el uso de afirmaciones excesivas o superlativas que pueden distorsionar la realidad del contenido ofrecido.", | |
| ) | |
| gr_contexto = gr.Slider( | |
| label="Omisión de Contexto", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se revela la falta de información contextual que es esencial para entender completamente la noticia o el argumento presentado.", | |
| ) | |
| gr_urgencia = gr.Slider( | |
| label="Urgencia Artificial", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se evalua el uso de frases que intentan crear una percepción de necesidad inmediata o limitación temporal sin justificación real.", | |
| ) | |
| gr_sensacionalismo = gr.Slider( | |
| label="Sensacionalismo", | |
| minimum=-2, | |
| maximum=5, | |
| step=1, | |
| value=0, | |
| info="Se distingue el contenido que busca impactar emocionalmente al lector mediante el uso de afirmaciones alarmantes o escandalosas sin fundamento sólido.", | |
| ) | |
| gr_manipulacion = gr.Radio( | |
| label="Influencia", | |
| choices=[("No se usan técnicas de manipulación",-1),("Se usan técnicas de manipulación",5)], | |
| info="Se analizan las técnicas utilizadas para influir en la percepción del lector o dirigir sus conclusiones de manera sesgada o con fines específicos.", | |
| ) | |
| gr_discrepancia = gr.Radio( | |
| label="Discrepancia Título-Contenido", | |
| choices=[("No hay discrepancia",-5),("Existe discrepancia",10)], | |
| info="Se evalua la coherencia entre los titulares y el cuerpo del artículo, asegurando que las expectativas generadas se cumplan efectivamente.", | |
| ) | |
| gr_promesas = gr.Radio( | |
| label="Promesas Incumplidas", | |
| choices=[("No hay promesas incumplidas",-1),("Hay promesas incumplidas",5)], | |
| info="Se detecta cuando los titulares hacen promesas específicas que el contenido no logra satisfacer, manteniendo un estándar de integridad informativa.", | |
| ) | |
| gr_incompleto = gr.Radio( | |
| label="Información Incompleta", | |
| choices=[("La información es completa",-1),("La información es incompleta",5)], | |
| info="Se identifica la omisión de detalles cruciales que son necesarios para una comprensión completa del tema, evitando tácticas que buscan meramente incentivar clics.", | |
| ) | |
| gr_generalScore = gr.Slider( | |
| label="Clasificación General", | |
| minimum=0, | |
| maximum=100, | |
| value=0, | |
| info="Clasificación general del nivel de clickbait del artículo en una escala del 0 al 100, donde 0 significa que el artículo no es clickbait y 100 significa que el artículo es clickbait en su máxima expresión.", | |
| ) | |
| save = gr.Button("💾 Enviar") | |
| save.click( | |
| fn=example_getter.update_example, | |
| inputs=[ | |
| gr_filename, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| gr_summary, | |
| gr_title_gpt, | |
| ], | |
| outputs=[ | |
| gr_progress, | |
| gr_filename, | |
| gr_title, | |
| gr_content, | |
| gr_title_gpt, | |
| gr_summary, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| ], | |
| ) | |
| gr_play.click( | |
| fn=example_getter.start_test, | |
| outputs=[ | |
| gr_progress, | |
| gr_filename, | |
| gr_title, | |
| gr_content, | |
| gr_title_gpt, | |
| gr_summary, | |
| gr_exageracion, | |
| gr_discrepancia, | |
| gr_promesas, | |
| gr_incompleto, | |
| gr_urgencia, | |
| gr_sensacionalismo, | |
| gr_manipulacion, | |
| gr_contexto, | |
| gr_generalScore, | |
| ], | |
| ) | |
| demo.launch(auth=(os.environ.get("pass"), os.environ.get("pass"))) | |