Team Ai
Modelpublic

AlgorithmicResearchGroup/phi-physics

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
0likes54downloads
README.md111 linesDownload Raw Back to root
1---2license: apache-2.03language:4- en5pipeline_tag: summarization6widget:7- text: What is the peak phase of T-eV?8  example_title: Question Answering9tags:10- arxiv11---12#  Table of Contents13 140. [TL;DR](#TL;DR)151. [Model Details](#model-details)162. [Usage](#usage)173. [Uses](#uses)184. [Citation](#citation)19 20# TL;DR21 22This is a Phi-1_5 model trained on [camel-ai/physics](https://huggingface.co/datasets/camel-ai/physics). This model is for research purposes only and ***should not be used in production settings***.23 24 25## Model Description26 27 28- **Model type:** Language model29- **Language(s) (NLP):** English30- **License:** Apache 2.031- **Related Models:** [Phi-1_5](https://huggingface.co/microsoft/phi-1_5)32 33# Usage34 35Find below some example scripts on how to use the model in `transformers`:36 37## Using the Pytorch model38 39```python40 41from huggingface_hub import notebook_login42from datasets import load_dataset, Dataset43from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer44 45model = "ArtifactAI/phi-physics"46 47model = AutoModelForCausalLM.from_pretrained(base_model, trust_remote_code= True)48tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)49 50def 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  55generate("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 Data59 60The model was trained on [camel-ai/phi-physics](https://huggingface.co/datasets/camel-ai/physics), a dataset of question/answer pairs. 61 62 63## Training procedure64 65 66The following `bitsandbytes` quantization config was used during training:67- quant_method: bitsandbytes68- load_in_8bit: False69- load_in_4bit: True70- llm_int8_threshold: 6.071- llm_int8_skip_modules: None72- llm_int8_enable_fp32_cpu_offload: False73- llm_int8_has_fp16_weight: False74- bnb_4bit_quant_type: nf475- bnb_4bit_use_double_quant: True76- bnb_4bit_compute_dtype: float1677 78### Framework versions79 80 81- PEFT 0.6.282## Training procedure83 84 85The following `bitsandbytes` quantization config was used during training:86- quant_method: bitsandbytes87- load_in_8bit: False88- load_in_4bit: True89- llm_int8_threshold: 6.090- llm_int8_skip_modules: None91- llm_int8_enable_fp32_cpu_offload: False92- llm_int8_has_fp16_weight: False93- bnb_4bit_quant_type: nf494- bnb_4bit_use_double_quant: True95- bnb_4bit_compute_dtype: float1696 97### Framework versions98 99 100- PEFT 0.6.2101 102# Citation103 104```105@misc{phi-math,106    title={phi-physics},107    author={Matthew Kenney},108    year={2023}109}110```111