Text Generation
Transformers
Safetensors
English
phi
convAI
conversational
ASR
custom_code
text-generation-inference
Instructions to use Thytu/phi-2-audio-super with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Thytu/phi-2-audio-super with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Thytu/phi-2-audio-super", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Thytu/phi-2-audio-super", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Thytu/phi-2-audio-super", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Thytu/phi-2-audio-super with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Thytu/phi-2-audio-super" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Thytu/phi-2-audio-super", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Thytu/phi-2-audio-super
- SGLang
How to use Thytu/phi-2-audio-super 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 "Thytu/phi-2-audio-super" \ --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": "Thytu/phi-2-audio-super", "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 "Thytu/phi-2-audio-super" \ --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": "Thytu/phi-2-audio-super", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Thytu/phi-2-audio-super with Docker Model Runner:
docker model run hf.co/Thytu/phi-2-audio-super
Commit History
Upload PhiForCausalLM 54e82d8 verified
Upload tokenizer 7f65600 verified
Upload PhiForCausalLM 8852749 verified
Upload tokenizer 621a1e9 verified
Upload PhiForCausalLM 88a34e2 verified
Upload tokenizer 806c9c4 verified
Upload PhiForCausalLM f6bc454 verified
Upload tokenizer 4a68d70 verified
Upload PhiForCausalLM de9387e verified
Update README.md b599b90 verified
Upload tokenizer ba088cb verified
Upload PhiForCausalLM 22947b5 verified
Upload tokenizer c9a7ec8 verified
Upload PhiForCausalLM 28fffd7 verified
Update README.md 627d41f verified
Upload tokenizer 981d0fb verified
Upload PhiForCausalLM 09b11f9 verified
delete: fp32 model bf55013
Valentin De Matos commited on