Instructions to use bickett/meme-llama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bickett/meme-llama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bickett/meme-llama")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bickett/meme-llama") model = AutoModelForCausalLM.from_pretrained("bickett/meme-llama", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bickett/meme-llama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bickett/meme-llama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bickett/meme-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bickett/meme-llama
- SGLang
How to use bickett/meme-llama 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 "bickett/meme-llama" \ --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": "bickett/meme-llama", "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 "bickett/meme-llama" \ --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": "bickett/meme-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bickett/meme-llama with Docker Model Runner:
docker model run hf.co/bickett/meme-llama
| language: en | |
| tags: | |
| - autotrain | |
| - text-generation | |
| - llm | |
| - memes | |
| library_name: transformers | |
| library_version: [latest version at the time of training] | |
| model_type: llama 2 | |
| widget: | |
| - text: "When you try to code without coffee, " | |
| # Llama 2 Meme Generator | |
| ## Model Description | |
| This model is a fine-tuned version of the `llama 2` model, specifically tailored for generating meme captions. It captures the essence and humor commonly found in popular internet memes and offers a unique approach to meme creation. Just provide a prompt or a meme context, and let the model generate a fitting caption! | |
| ## Training Data | |
| The model was trained using a diverse dataset of meme captions, spanning various internet trends, jokes, and pop culture references. This ensures a wide range of meme generation capabilities, from classic meme formats to contemporary internet humor. | |
| ## Training Procedure | |
| The model was fine-tuned using the `autotrain llm` command with optimal hyperparameters for meme generation. Special care was taken to avoid overfitting, ensuring the model can generalize well across various meme contexts. | |
| ## Usage | |
| To generate a meme caption using this model, you can use the following code: | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelWithLMHead | |
| tokenizer = AutoTokenizer.from_pretrained("bickett/meme-llama") | |
| model = AutoModelWithLMHead.from_pretrained("bickett/meme-llama") | |
| input_text = "When you try to code without coffee" | |
| input_ids = tokenizer.encode(input_text, return_tensors="pt") | |
| output = model.generate(input_ids) | |
| print(tokenizer.decode(output[0], skip_special_tokens=True)) | |