How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Realluke/phi-2-senator-tweets"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "Realluke/phi-2-senator-tweets",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Use Docker
docker model run hf.co/Realluke/phi-2-senator-tweets
Quick Links

Phi-2 Senator Tweets

Phi-2 finetuned on Senator Tweets.

The starting token is [start] and the ending token is [end]

Example:

from transformers import AutoTokenizer, AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("Realluke/phi-2-senator-tweets", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)

inputs = tokenizer("[start]", return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]

print(text)

Model Details

Model Description

  • Steps: 750
  • Finetuning Examples: 1000
  • GPU: NVIDIA Tesla T4
  • GPU Hours: 2
Downloads last month
14
Safetensors
Model size
3B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Realluke/phi-2-senator-tweets