Commit
·
063831e
1
Parent(s):
8edfe5a
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: summarization
|
| 6 |
+
widget:
|
| 7 |
+
- text: What is the peak phase of T-eV?
|
| 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 Phi-1_5 model trained on [camel-ai/physics](https://huggingface.co/datasets/meta-math/MetaMathQA). 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:** [Phi-1_5](https://huggingface.co/microsoft/phi-1_5)
|
| 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 |
+
```python
|
| 40 |
+
|
| 41 |
+
from huggingface_hub import notebook_login
|
| 42 |
+
from datasets import load_dataset, Dataset
|
| 43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
| 44 |
+
|
| 45 |
+
model = "ArtifactAI/phi-metamath"
|
| 46 |
+
|
| 47 |
+
model = AutoModelForCausalLM.from_pretrained(base_model, trust_remote_code= True)
|
| 48 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
|
| 49 |
+
|
| 50 |
+
def generate(prompt):
|
| 51 |
+
inputs = tokenizer(f'''Below is an instruction that describes a task. Write a response that appropriately completes the request If you are adding additional white spaces, stop writing".\n\n### Instruction:\n{prompt}.\n\n### Response:\n ''', return_tensors="pt", return_attention_mask=False)
|
| 52 |
+
streamer = TextStreamer(tokenizer, skip_prompt= True)
|
| 53 |
+
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=500)
|
| 54 |
+
|
| 55 |
+
generate("What are the common techniques used in identifying a new species, and how can scientists accurately categorize it within the existing taxonomy system?")
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Training Data
|
| 59 |
+
|
| 60 |
+
The model was trained on [camel-ai/phi-physics](https://huggingface.co/datasets/meta-math/MetaMathQA), a dataset of question/answer pairs.
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
## Training procedure
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
The following `bitsandbytes` quantization config was used during training:
|
| 67 |
+
- quant_method: bitsandbytes
|
| 68 |
+
- load_in_8bit: False
|
| 69 |
+
- load_in_4bit: True
|
| 70 |
+
- llm_int8_threshold: 6.0
|
| 71 |
+
- llm_int8_skip_modules: None
|
| 72 |
+
- llm_int8_enable_fp32_cpu_offload: False
|
| 73 |
+
- llm_int8_has_fp16_weight: False
|
| 74 |
+
- bnb_4bit_quant_type: nf4
|
| 75 |
+
- bnb_4bit_use_double_quant: True
|
| 76 |
+
- bnb_4bit_compute_dtype: float16
|
| 77 |
+
|
| 78 |
+
### Framework versions
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
- PEFT 0.6.2
|
| 82 |
+
## Training procedure
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
The following `bitsandbytes` quantization config was used during training:
|
| 86 |
+
- quant_method: bitsandbytes
|
| 87 |
+
- load_in_8bit: False
|
| 88 |
+
- load_in_4bit: True
|
| 89 |
+
- llm_int8_threshold: 6.0
|
| 90 |
+
- llm_int8_skip_modules: None
|
| 91 |
+
- llm_int8_enable_fp32_cpu_offload: False
|
| 92 |
+
- llm_int8_has_fp16_weight: False
|
| 93 |
+
- bnb_4bit_quant_type: nf4
|
| 94 |
+
- bnb_4bit_use_double_quant: True
|
| 95 |
+
- bnb_4bit_compute_dtype: float16
|
| 96 |
+
|
| 97 |
+
### Framework versions
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
- PEFT 0.6.2
|
| 101 |
+
|
| 102 |
+
# Citation
|
| 103 |
+
|
| 104 |
+
```
|
| 105 |
+
@misc{phi-metamath,
|
| 106 |
+
title={phi-metamath},
|
| 107 |
+
author={Matthew Kenney},
|
| 108 |
+
year={2023}
|
| 109 |
+
}
|
| 110 |
+
```
|