Instructions to use decruz07/llama-2-7b-miniguanaco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use decruz07/llama-2-7b-miniguanaco with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="decruz07/llama-2-7b-miniguanaco")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("decruz07/llama-2-7b-miniguanaco") model = AutoModelForCausalLM.from_pretrained("decruz07/llama-2-7b-miniguanaco") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use decruz07/llama-2-7b-miniguanaco with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "decruz07/llama-2-7b-miniguanaco" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "decruz07/llama-2-7b-miniguanaco", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/decruz07/llama-2-7b-miniguanaco
- SGLang
How to use decruz07/llama-2-7b-miniguanaco 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 "decruz07/llama-2-7b-miniguanaco" \ --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": "decruz07/llama-2-7b-miniguanaco", "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 "decruz07/llama-2-7b-miniguanaco" \ --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": "decruz07/llama-2-7b-miniguanaco", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use decruz07/llama-2-7b-miniguanaco with Docker Model Runner:
docker model run hf.co/decruz07/llama-2-7b-miniguanaco
llama-2-7b-miniguanaco
This is my first model, with LLama-2-7b model finetuned with miniguanaco datasets.
This is a simple finetune based off a Google Colab notebook. Finetune instructions were from Labonne's first tutorial.
To run it: import torch from transformers import AutoTokenizer, AutoModelForCausalLM import math
model_path = "decruz07/llama-2-7b-miniguanaco"
tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False) model = AutoModelForCausalLM.from_pretrained( model_path, torch_dtype=torch.float32, device_map='auto',local_files_only=False, load_in_4bit=True ) print(model) prompt = input("please input prompt:") while len(prompt) > 0: input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
generation_output = model.generate( input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2 ) print(tokenizer.decode(generation_output[0])) prompt = input("please input prompt:")
- Downloads last month
- 790