Instructions to use auhide/chef-gpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use auhide/chef-gpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="auhide/chef-gpt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("auhide/chef-gpt") model = AutoModelForCausalLM.from_pretrained("auhide/chef-gpt") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use auhide/chef-gpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "auhide/chef-gpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "auhide/chef-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/auhide/chef-gpt
- SGLang
How to use auhide/chef-gpt 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 "auhide/chef-gpt" \ --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": "auhide/chef-gpt", "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 "auhide/chef-gpt" \ --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": "auhide/chef-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use auhide/chef-gpt with Docker Model Runner:
docker model run hf.co/auhide/chef-gpt
chef-gpt
This model is a fine-tuned version of auhide/chef-gpt-base. Visit this website to test it out.
Model Description
This is GPT-2 pretrained on a custom Bulgarian dataset. You can find the dataset here.
The difference between this one and the base version is that this one can also generate recipes based on recipe name.
Usage
import re
# Using this library to beautifully print the long recipe string.
from pprint import pprint
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the model and tokenizer:
MODEL_ID = "auhide/chef-gpt"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
chef_gpt = AutoModelForCausalLM.from_pretrained(MODEL_ID)
# Prepare the input:
title = "Пиле с ориз"
input_text = f"[TTL]{title}[ING]"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
# Generate the text:
output = chef_gpt.generate(input_ids, max_length=150)
recipe = tokenizer.batch_decode(output)[0]
# Get the generated recipe - it is up until the 1st [SEP] token. It includes the ingredients.
recipe = re.findall(r"\[ING\](.+?)\[SEP\]", recipe)[0]
# Format the output text:
recipe = recipe.replace("[ING]", "- ")
recipe = recipe.replace("[EOL]", "\n- ")
recipe = recipe.replace("[REC]", "\n\n")
print("Име на рецепта/Recipe name:")
print(title)
print("\nРецепта/Recipe:")
pprint(recipe)
Име на рецепта/Recipe name:
Пиле с ориз
Рецепта/Recipe:
('- 2 бр. пилешки бутчета\n'
'- 1 кг зеле\n'
'- 1 ч.ч. ориз\n'
'- 1 ч.ч. доматено пюре\n'
'- 1 глава лук\n'
'- олио\n'
'- червен пипер, черен пипер, сол, джоджен, чубрица\n'
'- целина\n'
'\n'
'Бутчетата се сваряват, обезкостяват и месото се накъсва. Лукът се нарязва на '
'полумесеци е се задушава в олио. Прибавя се нарязаното на ивици зеле. Когато '
'зелето омекне се слага оризът, а като стане прозрачен се добавят '
'подправките. Разбърква се добре, полива се с доматеното пюре и 3 ч.ч. от '
'бульона, в който е вряло месото. Оставя се да ври на тих огън около 20-30 '
'минути. Ястието се прехвърля в тава и се пече на 250С докато изври водата.')
- Downloads last month
- 5
Model tree for auhide/chef-gpt
Base model
auhide/chef-gpt-base