Instructions to use ItalianMLDevs/TestForCheshire with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ItalianMLDevs/TestForCheshire with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ItalianMLDevs/TestForCheshire")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ItalianMLDevs/TestForCheshire") model = AutoModelForCausalLM.from_pretrained("ItalianMLDevs/TestForCheshire", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ItalianMLDevs/TestForCheshire with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ItalianMLDevs/TestForCheshire" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ItalianMLDevs/TestForCheshire", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ItalianMLDevs/TestForCheshire
- SGLang
How to use ItalianMLDevs/TestForCheshire 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 "ItalianMLDevs/TestForCheshire" \ --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": "ItalianMLDevs/TestForCheshire", "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 "ItalianMLDevs/TestForCheshire" \ --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": "ItalianMLDevs/TestForCheshire", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ItalianMLDevs/TestForCheshire with Docker Model Runner:
docker model run hf.co/ItalianMLDevs/TestForCheshire
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ItalianMLDevs/TestForCheshire")# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ItalianMLDevs/TestForCheshire")
model = AutoModelForCausalLM.from_pretrained("ItalianMLDevs/TestForCheshire", device_map="auto")YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Project for Big Data
Prerequisites
Install the following:
- transformers
- huggingface-cli
Setting up
Clone this repository and in constants folder create a new file called "api.py". Then, past there the following line:
api = "Bearer [YOUR HUGGING_FACE API KEY]"
Replace the placeholder with your Hugging Face API key
Asking for completions
Run the script send_question.py to request a completion, to send a different question edit question_input variable into question.py file.
Errors
Sometimes Hugging Face returns the "file not ready" error, try running the send_question.py multiple times
- Downloads last month
- -
# Gated model: Login with a HF token with gated access permission hf auth login