File size: 1,604 Bytes
bb5469d
 
 
 
 
e7fd418
9e1112d
5ded769
85bec6f
e7fd418
5ded769
e7fd418
5ded769
e7fd418
5397958
f35bf66
85bec6f
6d91694
 
 
 
 
 
 
 
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
---
library_name: peft
base_model: mistralai/Mistral-7B-v0.1
pipeline_tag: text-generation
---
Description: Topic identification from a news article, with synthetic explanations.\
Original dataset: https://huggingface.co/datasets/ag_news \
---\
Try querying this adapter for free in Lora Land at https://predibase.com/lora-land! \
The adapter_category is Explanation and the name is News Topic Identification Explained (ag_news)\
---\
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: {"text_label": "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)
```