CoolFace
Modelpublic

predibase/agnews_explained

sourceHugging Faceupdated 3y agoView on Hugging Face
1likes36downloads
Model Card

Description: Topic identification from a news article, with synthetic explanations.\ Original dataset: https://huggingface.co/datasets/agnews \ ---\ Try querying this adapter for free in Lora Land at https://predibase.com/lora-land! \ The adaptercategory is Explanation and the name is News Topic Identification Explained (agnews)\ ---\ Sample input: Below is a news article. Please classify it under one of the following classes (World, Business, Sports, Sci/Tech) and provide a reasonable coherent explanation for why the article is classified as such. Please format your response as a JSON payload.\n\n### Article: US poverty rate climbs, along with number lacking health coverage (AFP) AFP - The number of Americans living in poverty or without health insurance grew last year, a government survey showed, adding potential dynamite in the battle for the White House.\n\n### JSON Response\ ---\ Sample output: {"textlabel": "World", "explanation": "The article is classified as 'World' because it discusses the poverty rate and lack of health coverage in the United States. Although it is a domestic issue, it has potential implications for the upcoming presidential election, making it relevant to a global audience."}\ ---\ Try using this adapter yourself!

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "mistralai/Mistral-7B-v0.1"
peft_model_id = "predibase/agnews_explained"

model = AutoModelForCausalLM.from_pretrained(model_id)
model.load_adapter(peft_model_id)