matthewkenney
commited on
Commit
•
6186639
1
Parent(s):
621becd
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 [ArtifactAI/arxiv-cs-ml-instruct-50k](https://huggingface.co/datasets/ArtifactAI/arxiv-cs-ml-instruct-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:** [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-arxiv-cs-ml-instruct"
|
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 is a transformer?")
|
56 |
+
```
|
57 |
+
|
58 |
+
## Training Data
|
59 |
+
|
60 |
+
The model was trained on [ArtifactAI/arxiv-math-instruct-50k](https://huggingface.co/datasets/ArtifactAI/arxiv-math-instruct-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.
|
61 |
+
|
62 |
+
# Citation
|
63 |
+
|
64 |
+
```
|
65 |
+
@misc{phi-arxiv-cs-ml-instruct,
|
66 |
+
title={phi-arxiv-cs-ml-instruct},
|
67 |
+
author={Matthew Kenney},
|
68 |
+
year={2023}
|
69 |
+
}
|
70 |
+
```
|