How to use from
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 "ayoubkirouane/phi-2-arxiv-physics" \
    --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": "ayoubkirouane/phi-2-arxiv-physics",
		"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 "ayoubkirouane/phi-2-arxiv-physics" \
        --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": "ayoubkirouane/phi-2-arxiv-physics",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

Phi-2-arxiv-physics :

Phi-2-arxiv-physics is a small language model (SLM) derived from Microsoft Research's Phi-2, a Transformer-based model with 2.7 billion parameters. Specifically fine-tuned using the innovative QLoRA (Quantized Low-rank Adapters) technique, this model exhibits remarkable capabilities in the domain of physics-related text.

Fine-Tuning:

The model has been fine-tuned using QLoRA, a technique that reduces computational and memory requirements during the fine-tuning process.

This two-stage approach involves quantizing parameters and introducing learnable low-rank adapters, resulting in faster fine-tuning with reduced memory demands.

Data Source:

Phi-2-arxiv-physics is specifically trained on the arXiv-physics dataset, consisting of questions and answers related to physics.

This dataset is sourced from the arXiv repository, encompassing a wide range of topics within the field of physics.

Usage (High-level) :

!pip install -q -U git+https://github.com/huggingface/transformers.git

from transformers import pipeline

pipe = pipeline("text-generation", model="ayoubkirouane/phi-2-arxiv-physics")

## or :

# load it directly
from transformers import AutoModel
model = AutoModel.from_pretrained("ayoubkirouane/phi-2-arxiv-physics")
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train ayoubkirouane/phi-2-arxiv-physics