Instructions to use maicomputer/toolpaca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use maicomputer/toolpaca with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="maicomputer/toolpaca")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("maicomputer/toolpaca") model = AutoModelForCausalLM.from_pretrained("maicomputer/toolpaca") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use maicomputer/toolpaca with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "maicomputer/toolpaca" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "maicomputer/toolpaca", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/maicomputer/toolpaca
- SGLang
How to use maicomputer/toolpaca 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 "maicomputer/toolpaca" \ --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": "maicomputer/toolpaca", "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 "maicomputer/toolpaca" \ --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": "maicomputer/toolpaca", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use maicomputer/toolpaca with Docker Model Runner:
docker model run hf.co/maicomputer/toolpaca
What is the correct prompt format?
Hi, I want to test toolpaca but not sure what is the correct prompt format.
What I tried is the standford Alpaca format. For example:
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
toolformer: enabled
toolformer access: wikipedia
A wrapper around Wikipedia. Useful for when you need to display general information about people, places, companies, historical events, or other subjects found in an encyclopedia, displays a snippet summary of the topic. Input should be a search query.
wikipedia(query)
Find the answer to a general knowledge question based on the input given
### Input:
Who is the current president of the United States?
### Response:
However this does not work.
Yeah idk what happened during training but its broken
unfortunate
Yeah idk what happened during training but its broken
I see. Anyway thanks for all the efforts on training various great alpaca models, chavinlo! Do you mind guiding me to the script/codebase you used to train toolpaca? Is it the original standford alpaca repo or a toolformer implementation? I would like to learn more and hopefully to debug it
Original alpaca repo
Original alpaca repo
Thanks!