Instructions to use theoracle/autotrain-kaggle with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use theoracle/autotrain-kaggle with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="theoracle/autotrain-kaggle") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("theoracle/autotrain-kaggle", dtype="auto") - PEFT
How to use theoracle/autotrain-kaggle with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use theoracle/autotrain-kaggle with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "theoracle/autotrain-kaggle" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "theoracle/autotrain-kaggle", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/theoracle/autotrain-kaggle
- SGLang
How to use theoracle/autotrain-kaggle 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 "theoracle/autotrain-kaggle" \ --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": "theoracle/autotrain-kaggle", "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 "theoracle/autotrain-kaggle" \ --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": "theoracle/autotrain-kaggle", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use theoracle/autotrain-kaggle with Docker Model Runner:
docker model run hf.co/theoracle/autotrain-kaggle
Overview
Developed with the cutting-edge AutoTrain and PEFT technologies, this model is specifically trained to provide detailed answers to questions about Kaggle. Whether you're wondering how to get started, how to submit to a competition, or how to navigate the datasets, this model is equipped to assist.
Key Features
- Kaggle-Specific Knowledge: Designed to offer insights and guidance on using Kaggle, from competition submissions to data exploration.
- Powered by AutoTrain: Utilizes Hugging Face's AutoTrain for efficient and effective training, ensuring high-quality responses.
- PEFT Enhanced: Benefits from PEFT for improved performance and efficiency, making it highly scalable and robust.
Usage
The following Python code snippet illustrates how to use this model to answer your Kaggle-related questions:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "theoracle/autotrain-kaggle"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto'
).eval()
tokenizer.pad_token = tokenizer.eos_token
prompt = '''
### How do I prepare for Kaggle competitions?\n ### Answer:
'''
encoding = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True, max_length=500, add_special_tokens=True)
input_ids = encoding['input_ids']
attention_mask = encoding['attention_mask']
output_ids = model.generate(
input_ids.to('cuda'),
attention_mask=attention_mask.to('cuda'),
max_new_tokens=300,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(response)
Application Scenarios
This model is particularly useful for:
- Kaggle competitors seeking advice on strategy and submissions.
- Educators and students looking for a tool to facilitate learning through Kaggle competitions.
- Data scientists requiring quick access to information about Kaggle datasets and competitions.
About AutoTrain and PEFT
AutoTrain by Hugging Face streamlines the model training process, making it easier and more efficient to develop state-of-the-art models. PEFT enhances this by providing a framework for efficient model training and deployment. Together, they enable this model to deliver fast and accurate responses to your Kaggle inquiries.
License
This model is distributed under an "other" license, allowing diverse applications while encouraging users to review the license terms for compliance with their project requirements.