Instructions to use abideen/gemma-7b-openhermes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abideen/gemma-7b-openhermes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abideen/gemma-7b-openhermes") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("abideen/gemma-7b-openhermes") model = AutoModelForCausalLM.from_pretrained("abideen/gemma-7b-openhermes") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use abideen/gemma-7b-openhermes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abideen/gemma-7b-openhermes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abideen/gemma-7b-openhermes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/abideen/gemma-7b-openhermes
- SGLang
How to use abideen/gemma-7b-openhermes 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 "abideen/gemma-7b-openhermes" \ --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": "abideen/gemma-7b-openhermes", "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 "abideen/gemma-7b-openhermes" \ --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": "abideen/gemma-7b-openhermes", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use abideen/gemma-7b-openhermes with Docker Model Runner:
docker model run hf.co/abideen/gemma-7b-openhermes
Why fine-tune the instruct version?
The instruct version of Gemma is astonishingly bad. It basically contains nothing but 1000s of 'As an AI model I can't answer that' alignment. As a result it scores about 10 points lower than their foundational models. And even the Gemma foundational models are stripped of basic information that isn't the least bit illegal or amoral.
If you're going to get anything remotely useful out of Gemma you need to start with the foundational model and train it with a lot of basic information about reality that Google stripped from the training tokens.
I'm seeing a lot more censorship/alignment/moralizing/... in non-Meta/Mistral LLMs and it's starting to concern me. Stripping basic facts out of AI models is the action of tyrannical governments such as Russia, China and Iran. It has no place in free countries like US and European nations. Gemma is dead on arrival. No AI model should strip basic facts from its foundational model, then strip even more from its chat models. Gemma is an embarrassment.
@Phil337 Your wrong, most people were using the gguf files that google uploaded, but the file was broken. The gguf files found here are not broken and work surprisingly well. Even better than mistral-7b
https://huggingface.co/dranger003/gemma-7b-it-iMat.GGUF/tree/main
@rombodawg Do you still think gemma-7b-it is "even better than Mistral-7b"?
I'm holding off judging the foundational model until it's properly fine-tuned by 3rd parties, but I tried over a half dozen implementation of gemma-7b-it, and not just the problematic GGUF, and it's astonishingly bad at times. The majority of testers are saying the same, plus it scored a full 10 points lower than its foundational model on the leaderboard.
If I was an engineer who worked on Gemma I'd be furious. The alignment team lobotomized it, making it perform far worse and less reliably than it otherwise would. It's almost comical what it won't respond to and how bad he responses often are.