Instructions to use Ishika08/phi-4_fine-tuned_mdl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ishika08/phi-4_fine-tuned_mdl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ishika08/phi-4_fine-tuned_mdl") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Ishika08/phi-4_fine-tuned_mdl", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ishika08/phi-4_fine-tuned_mdl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ishika08/phi-4_fine-tuned_mdl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ishika08/phi-4_fine-tuned_mdl", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ishika08/phi-4_fine-tuned_mdl
- SGLang
How to use Ishika08/phi-4_fine-tuned_mdl 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 "Ishika08/phi-4_fine-tuned_mdl" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ishika08/phi-4_fine-tuned_mdl", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Ishika08/phi-4_fine-tuned_mdl" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ishika08/phi-4_fine-tuned_mdl", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Ishika08/phi-4_fine-tuned_mdl with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ishika08/phi-4_fine-tuned_mdl to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ishika08/phi-4_fine-tuned_mdl to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Ishika08/phi-4_fine-tuned_mdl to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Ishika08/phi-4_fine-tuned_mdl", max_seq_length=2048, ) - Docker Model Runner
How to use Ishika08/phi-4_fine-tuned_mdl with Docker Model Runner:
docker model run hf.co/Ishika08/phi-4_fine-tuned_mdl
- Uploaded model
- API URL for the model hosted on Hugging Face
- Set up your Hugging Face API token
- The input you want to pass to the model
- Make the request to the API
- Print the response from the model
- OUTPUT
- Initialize the client with model name and Hugging Face token
- Perform inference (text generation in this case)
- Print the response from the model
Uploaded model
- Developed by: Ishika08
- License: apache-2.0
- Finetuned from model : unsloth/phi-4-unsloth-bnb-4bit
This phi model was trained 2x faster with Unsloth and Huggingface's TRL library.
How to Use the Model for Inferencing
You can use the model for inferencing via Hugging Face's API by following the steps below:
1. Install Required Libraries
Ensure that you have the requests library installed:
pip install requests
Steps to use the model for inferencing using Hugging Face API
import requests
API URL for the model hosted on Hugging Face
API_URL = "https://api-inference.huggingface.co/models/Ishika08/phi-4_fine-tuned_mdl"
Set up your Hugging Face API token
HEADERS = {"Authorization": f"Bearer token_id"}
The input you want to pass to the model
payload = { "inputs": "What is the capital of France? Tell me some of the tourist places in bullet points." }
Make the request to the API
response = requests.post(API_URL, headers=HEADERS, json=payload)
Print the response from the model
print(response.json()) # Get the response output
OUTPUT
{ "generated_text": "Paris is the capital of France. Some of the famous tourist places include:\n- Eiffel Tower\n- Louvre Museum\n- Notre-Dame Cathedral\n- Sacré-Cœur Basilica" }
Steps to use model using InferenceClient library from huggingface_hub
from huggingface_hub import InferenceClient
Initialize the client with model name and Hugging Face token
client = InferenceClient(model="Ishika08/phi-4_fine-tuned_mdl", token=""")
Perform inference (text generation in this case)
response = client.text_generation("What is the capital of France? Tell me about Eiffel Tower history in bullet points.")
Print the response from the model
print(response)
- Downloads last month
- 2
