ArtifactAI commited on
Commit
af0e6e7
·
1 Parent(s): 40ef20b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +80 -0
README.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ pipeline_tag: summarization
6
+ widget:
7
+ - text: What is an LSTM?
8
+ example_title: Question Answering
9
+ tags:
10
+ - arxiv
11
+ ---
12
+ # Table of Contents
13
+
14
+ 0. [TL;DR](#TL;DR)
15
+ 1. [Model Details](#model-details)
16
+ 2. [Usage](#usage)
17
+ 3. [Uses](#uses)
18
+ 4. [Citation](#citation)
19
+
20
+ # TL;DR
21
+
22
+ This is a FLAN-T5-XXL model trained on [ArtifactAI/arxiv-math-instruct-tune-50k](ArtifactAI/arxiv-math-instruct-tune-50k). This model is for research purposes only and *should not be used in production settings*.
23
+
24
+
25
+ ## Model Description
26
+
27
+
28
+ - **Model type:** Language model
29
+ - **Language(s) (NLP):** English
30
+ - **License:** Apache 2.0
31
+ - **Related Models:** [All FLAN-T5 Checkpoints](https://huggingface.co/models?search=flan-t5)
32
+
33
+ # Usage
34
+
35
+ Find below some example scripts on how to use the model in `transformers`:
36
+
37
+ ## Using the Pytorch model
38
+
39
+ ### Running the model on a CPU
40
+
41
+
42
+ ```python
43
+
44
+ import torch
45
+ from peft import PeftModel, PeftConfig
46
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
47
+
48
+ # Load peft config for pre-trained checkpoint etc.
49
+ peft_model_id = "ArtifactAI/flant5-xxl-math-full-training-run-one"
50
+ config = PeftConfig.from_pretrained(peft_model_id)
51
+
52
+ # load base LLM model and tokenizer
53
+ model = AutoModelForSeq2SeqLM.from_pretrained(config.base_model_name_or_path, load_in_8bit=True, device_map={"":0})
54
+ tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
55
+
56
+ # Load the Lora model
57
+ model = PeftModel.from_pretrained(model, peft_model_id, device_map={"":0})
58
+ model.eval()
59
+
60
+
61
+ input_ids = tokenizer("What is the peak phase of T-eV?", return_tensors="pt", truncation=True).input_ids.cuda()
62
+ # with torch.inference_mode():
63
+ outputs = model.generate(input_ids=input_ids, max_new_tokens=1000, do_sample=True, top_p=0.9)
64
+
65
+ print(f"summary:\n{tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0]}")
66
+ ```
67
+
68
+ ## Training Data
69
+
70
+ The model was trained on [ArtifactAI/arxiv-math-instruct-tune-50k](ArtifactAI/arxiv-math-instruct-tune-50k), a dataset of question/answer pairs. Questions are generated using the t5-base model, while the answers are generated using the GPT-3.5-turbo model.
71
+
72
+ # Citation
73
+
74
+ ```
75
+ @misc{flant5-xxl-math-full-training-run-one,
76
+ title={flant5-xxl-math-full-training-run-one},
77
+ author={Matthew Kenney},
78
+ year={2023}
79
+ }
80
+ ```