Instructions to use VishalMysore/cookgptlama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VishalMysore/cookgptlama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VishalMysore/cookgptlama") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("VishalMysore/cookgptlama") model = AutoModelForCausalLM.from_pretrained("VishalMysore/cookgptlama") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VishalMysore/cookgptlama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VishalMysore/cookgptlama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VishalMysore/cookgptlama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VishalMysore/cookgptlama
- SGLang
How to use VishalMysore/cookgptlama 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 "VishalMysore/cookgptlama" \ --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": "VishalMysore/cookgptlama", "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 "VishalMysore/cookgptlama" \ --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": "VishalMysore/cookgptlama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use VishalMysore/cookgptlama with Docker Model Runner:
docker model run hf.co/VishalMysore/cookgptlama
Model Trained Using AutoTrain
This model was fined tuned on 10K + Indian food recipes , the base model is TinyLlama/TinyLlama-1.1B-Chat-v0.6 (https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6 )
Dataset used for this Model is here https://huggingface.co/datasets/VishalMysore/cookGPT
CookGPT: Your AI-Based Chef
CookGPT is an innovative AI-based chef that combines the charm of traditional cooking with the efficiency of modern technology. Whether you're a culinary enthusiast, a busy professional, or someone looking for culinary inspiration, CookGPT is designed to make your cooking experience delightful, personalized, and effortless.
Original Source code and all the related information is here
https://github.com/vishalmysore/cookGPT
How to use
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model = AutoModelForCausalLM.from_pretrained("VishalMysore/cookgptlama")
tokenizer = AutoTokenizer.from_pretrained("VishalMysore/cookgptlama")
or you can load it in 8bit precision
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "VishalMysore/cookgptlama"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model_8bit = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto",load_in_8bit=True)
print(model_8bit.get_memory_footprint())
Then use pipeline to query and interact
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
messages = [
{
"role": "system",
"content": "you are an expert chef in Indian recipe",
},
{"role": "user", "content": "give me receipe for paneer butter masala with cook time diet and cusine and instructions"},
]
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
Complete notebook for training and querying is here https://github.com/vishalmysore/AI/blob/main/Llama_CookGPT_AutoTrain_LLM.ipynb
- Downloads last month
- 6,340