Instructions to use dfurman/phi-2-scientific-papers-base-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dfurman/phi-2-scientific-papers-base-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dfurman/phi-2-scientific-papers-base-v0.1", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dfurman/phi-2-scientific-papers-base-v0.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("dfurman/phi-2-scientific-papers-base-v0.1", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dfurman/phi-2-scientific-papers-base-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dfurman/phi-2-scientific-papers-base-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dfurman/phi-2-scientific-papers-base-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dfurman/phi-2-scientific-papers-base-v0.1
- SGLang
How to use dfurman/phi-2-scientific-papers-base-v0.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dfurman/phi-2-scientific-papers-base-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dfurman/phi-2-scientific-papers-base-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dfurman/phi-2-scientific-papers-base-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dfurman/phi-2-scientific-papers-base-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dfurman/phi-2-scientific-papers-base-v0.1 with Docker Model Runner:
docker model run hf.co/dfurman/phi-2-scientific-papers-base-v0.1
Model Card for dfurman/phi-2-scientific-papers-base-v0.1
A base model for scientific papers trained on 70MB (txt file) of research literature.
Model Details
Model Description
- Developed by: Daniel Furman
- Model type: Phi-2
- Language(s) (NLP): English
- License: Apache 2.0
- Finetuned from model: microsoft/phi-2
Uses
The intended use of this model includes scientific paper next word prediction. It is a base model for the scientific research domain.
Direct Use
Use for document completion on scientific papers.
Downstream Use
Finetune for other tasks in scientific literature domain, like Q&A on scientific papers.
Out-of-Scope Use
Anything outside of scientific research adjacent NLP tasks.
Bias, Risks, and Limitations
No guardrails are baked into this model. Use at your own risk.
Compute Info
This model was fine-tuned using the accelerate package on a cluster from RunPod with 4x A100-SXM4-80GB GPUs (99% memory usage across each during training).
- Downloads last month
- 9
Model tree for dfurman/phi-2-scientific-papers-base-v0.1
Base model
microsoft/phi-2