Instructions to use akoksal/LongForm-LLaMA-7B-diff with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use akoksal/LongForm-LLaMA-7B-diff with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="akoksal/LongForm-LLaMA-7B-diff")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-LLaMA-7B-diff") model = AutoModelForCausalLM.from_pretrained("akoksal/LongForm-LLaMA-7B-diff") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use akoksal/LongForm-LLaMA-7B-diff with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "akoksal/LongForm-LLaMA-7B-diff" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akoksal/LongForm-LLaMA-7B-diff", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/akoksal/LongForm-LLaMA-7B-diff
- SGLang
How to use akoksal/LongForm-LLaMA-7B-diff 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 "akoksal/LongForm-LLaMA-7B-diff" \ --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": "akoksal/LongForm-LLaMA-7B-diff", "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 "akoksal/LongForm-LLaMA-7B-diff" \ --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": "akoksal/LongForm-LLaMA-7B-diff", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use akoksal/LongForm-LLaMA-7B-diff with Docker Model Runner:
docker model run hf.co/akoksal/LongForm-LLaMA-7B-diff
Model
Unfortunately, I was not able to create a model using these weights. Can you upload the model instead of the diff?
Sorry to hear that. I am unable to directly share the finetuned model due to potential license restrictions with LLaMA. If it changes, I will notify you. In the meantime, if you can provide more details about the error, I could try to help.
Alternatively, I have just tried to use huggyllama/llama-7b as the original_llama_path in the script that I've shared. It worked fine in my case, so maybe you can also try that.
That's exactly what I used to merge. I used your script from the card. But I replaced the paths in lines 5, 14 and 15 with local paths, since I downloaded the llama and diff weights first. Should the diff weights in this case also be replaced by the model weights?
The fact is that my merge was complete, but for some reason the model answered nonsense. So I concluded that I had failed. Or should I not replace the paths in the script with local ones?