Instructions to use berkeley-nest/Starling-LM-7B-alpha with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use berkeley-nest/Starling-LM-7B-alpha with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="berkeley-nest/Starling-LM-7B-alpha") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("berkeley-nest/Starling-LM-7B-alpha") model = AutoModelForCausalLM.from_pretrained("berkeley-nest/Starling-LM-7B-alpha") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use berkeley-nest/Starling-LM-7B-alpha with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "berkeley-nest/Starling-LM-7B-alpha" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "berkeley-nest/Starling-LM-7B-alpha", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/berkeley-nest/Starling-LM-7B-alpha
- SGLang
How to use berkeley-nest/Starling-LM-7B-alpha 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 "berkeley-nest/Starling-LM-7B-alpha" \ --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": "berkeley-nest/Starling-LM-7B-alpha", "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 "berkeley-nest/Starling-LM-7B-alpha" \ --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": "berkeley-nest/Starling-LM-7B-alpha", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use berkeley-nest/Starling-LM-7B-alpha with Docker Model Runner:
docker model run hf.co/berkeley-nest/Starling-LM-7B-alpha
The Model move betwwen languages
I've discovered that this model doesn't always respond in English, and if your query isn't very explicit, it might respond in another language.I had encountered this twice.
Example>>> LLAMA research team
LLAMA (Large Language Models and Application) Research Team является группой ученых и разработчиков, которые работают над созданием и изучением крупных языковых моделей. Они известны своим вклад
область больших языковых моделей, включая разработку формата безопасного сохранения (Safetensors), который был представлен в исследовательской статье и направлен на эффективное хранение и передач
огромных языковых моделей.
LLAMA Research Team связан с Hugging Face, компанией, которая разрабатывает инструменты и библиотеки для машинного обучения и естественно-языкового программирования. Ллама-модели доступны через Hugging
Face Model Hub и могут быть легко использованы с помощью фреймворков, совместимых с PyTorch или TensorFlow, таких как Transformers от Hugging Face.
На протяжении последних нескольких лет LLAMA Research Team публикует исследования и разработки по крупным языковым моделям в академических журналах и конференциях. Они также участвуют в
стандартов и методов для обучения и использования языковых моделей, что способствует повышению качества и доступности таких моделей для научных исследований и приложений.
Если у вас есть вопросы или запросы, связанные с LLAMA Research Team или Safetensors, я буду рад помочь вам ответить на них и предоставить дополнительную информацию, если она потребуется.
Для получения дополнительной информации об LLAMA Research Team и их проектах вы можете посетить официальный сайт Hugging Face или обратиться к научным статьям и конференциям, упомя^C
May I ask if you're using the default chat template? (GPT4 Correct User: Hello! GPT4 Correct Assistant:) The model with a wrong chat template will perform very poorly.
Another possibility is to try a lower temperature, our testing suggests that temperature 0 might be slightly better than 0.7.
You may want to first try a bit on chat.lmsys.org. If you also observe the same issue there, then it'll just be the issue with the model. I actually tried this question a bit. The answer is "I don't have knowledge on that." And then hallucinates some random answers. Seems to be slightly better than what you get (at least it's English lol).
But still yes the model will output weird content in some cases, potentially due to uncareful RLHF. We're still working to fix it in the next version. Please stay tuned!