From e394e4ee43e0dcbaf0c30d27d53ba850ff611494 Mon Sep 17 00:00:00 2001 From: dc Date: Thu, 28 Sep 2023 15:44:30 +0000 Subject: [PATCH] Update README.md --- README.md | 25 ++++++++++++++++++++----- test_generate.py | 2 ++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7ad9880..b6d9c6c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Mistral Transformer -This repository contains minimal code to run our 7B model. -[Discord](https://discord.com/invite/mistralai) +This repository contains minimal code to run our 7B model.\ +Blog: [https://mistral.ai/news/announcing-mistral-7b/](https://mistral.ai/news/announcing-mistral-7b/)\ +Discord: [https://discord.com/invite/mistralai](https://discord.com/invite/mistralai) ## Installation @@ -9,17 +10,27 @@ This repository contains minimal code to run our 7B model. pip install -r requirements.txt ``` +## Download the model +``` +wget https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-v0.1.tar +tar -xf mistral-7B-v0.1.tar +``` + ## Run the model ``` -python -m main demo /path/to/model +python -m main demo /path/to/mistral-7B-v0.1/ # To give your own prompts -python -m main interactive /path/to/model +python -m main interactive /path/to/mistral-7B-v0.1/ +``` +Change `temperature` or `max_tokens` using: +``` +python -m main interactive /path/to/mistral-7B-v0.1/ --max_tokens 256 --temperature 1.0 ``` If you want a self-contained implementation, look at `one_file_ref.py`, or run it with ``` -python -m one_file_ref /path/to/model +python -m one_file_ref /path/to/mistral-7B-v0.1/ This is a test of the emergency broadcast system. This is only a test. @@ -88,6 +99,10 @@ For this we can choose as chunk size the window size. For each chunk, we thus ne ![Chunking](assets/chunking.png) +## More Links + +[Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) and [Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1) are also available on HuggingFace. + ## References [1] [Generating Long Sequences with Sparse Transformers, Child et al. 2019](https://arxiv.org/pdf/1904.10509.pdf) diff --git a/test_generate.py b/test_generate.py index 466bf1e..0bc6094 100644 --- a/test_generate.py +++ b/test_generate.py @@ -59,6 +59,8 @@ def test_generation(): for lp_old, lp_new in zip(all_logprobs_old, all_logprobs_new): assert all([abs(x - y) < 1e-5 for x, y in zip(lp_old, lp_new)]), f"\n{lp_old}\n{lp_new}" + print("All tests passed.") + def test_chunks(): torch.manual_seed(42)