Model Intelligence Sheet
richarderkhov/tokyotech-llm_-_swallow-70b-nve-instruct-hf-gguf overview
Our Swallow model has undergone continual pre-training from the Llama 2 family, primarily with the addition of Japanese language data. The tuned versions use supervised fine-tuning (SFT). Links to other models can be found in the index. # Model Release Updates We are excited to share the release schedule for our latest models:
Downloads
186
Likes
0
Pipeline
—
Library
—
Visibility
Public
Access
Open
Repository Files & Downloads
32 files detected
Direct downloads for all repository files
| File | Type | Quantization | Size | Link |
|---|---|---|---|---|
| Swallow-70b-NVE-instruct-hf.IQ3_M.gguf | GGUF | IQ3_M | 28.82 GB | Download |
| Swallow-70b-NVE-instruct-hf.IQ3_S.gguf | GGUF | IQ3_S | 27.86 GB | Download |
| Swallow-70b-NVE-instruct-hf.IQ3_XS.gguf | GGUF | IQ3_XS | 26.37 GB | Download |
| Swallow-70b-NVE-instruct-hf.IQ4_NL.gguf | GGUF | IQ4_NL | 36.55 GB | Download |
| Swallow-70b-NVE-instruct-hf.IQ4_XS.gguf | GGUF | IQ4_XS | 34.64 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q2_K.gguf | GGUF | Q2_K | 23.71 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q3_K.gguf | GGUF | Q3_K | 30.99 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q3_K_L.gguf | GGUF | Q3_K_L | 33.67 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q3_K_M.gguf | GGUF | Q3_K_M | 30.99 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q3_K_S.gguf | GGUF | Q3_K_S | 27.86 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q4_0.gguf | GGUF | — | 36.20 GB | Download |
| Swallow-70b-NVE-instruct-hf.Q4_K_S.gguf | GGUF | Q4_K_S | 36.55 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q4_1-00001-of-00002.gguf | GGUF | — | 37.15 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q4_1-00002-of-00002.gguf | GGUF | — | 3.05 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q4_K-00001-of-00002.gguf | GGUF | Q4_K | 37.16 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q4_K-00002-of-00002.gguf | GGUF | Q4_K | 1.42 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q4_K_M-00001-of-00002.gguf | GGUF | Q4_K_M | 37.16 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q4_K_M-00002-of-00002.gguf | GGUF | Q4_K_M | 1.42 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_0-00001-of-00002.gguf | GGUF | — | 37.18 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_0-00002-of-00002.gguf | GGUF | — | 7.02 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_1-00001-of-00002.gguf | GGUF | — | 37.24 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_1-00002-of-00002.gguf | GGUF | — | 10.96 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_K-00001-of-00002.gguf | GGUF | Q5_K | 37.17 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_K-00002-of-00002.gguf | GGUF | Q5_K | 8.23 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_K_M-00001-of-00002.gguf | GGUF | Q5_K_M | 37.17 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_K_M-00002-of-00002.gguf | GGUF | Q5_K_M | 8.23 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_K_S-00001-of-00002.gguf | GGUF | Q5_K_S | 37.18 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q5_K_S-00002-of-00002.gguf | GGUF | Q5_K_S | 7.02 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q6_K-00001-of-00002.gguf | GGUF | Q6_K | 37.17 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q6_K-00002-of-00002.gguf | GGUF | Q6_K | 15.53 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q8_0-00001-of-00002.gguf | GGUF | — | 37.13 GB | Download |
| Swallow-70b-NVE-instruct-hf_Q8_0-00002-of-00002.gguf | GGUF | — | 31.12 GB | Download |
Model Details Live
Metadata Inspector
Normalized metadata (stored in metadata_json)
{
"metadata": {},
"card_data": {
"frontmatter": {},
"hero_image_url": "./logo.png",
"summary": "Our Swallow model has undergone continual pre-training from the Llama 2 family, primarily with the addition of Japanese language data. The tuned versions use supervised fine-tuning (SFT). Links to other models can be found in the index. # Model Release Updates We are excited to share the release schedule for our latest models:",
"quick_links": [],
"benchmark_table_html": "",
"readme_markdown": "Quantization made by Richard Erkhov.\n\n[Github](https://github.com/RichardErkhov)\n\n[Discord](https://discord.gg/pvy7H8DZMG)\n\n[Request more models](https://github.com/RichardErkhov/quant_request)\n\n\nSwallow-70b-NVE-instruct-hf - GGUF\n- Model creator: https://huggingface.co/tokyotech-llm/\n- Original model: https://huggingface.co/tokyotech-llm/Swallow-70b-NVE-instruct-hf/\n\n\n| Name | Quant method | Size |\n| ---- | ---- | ---- |\n| [Swallow-70b-NVE-instruct-hf.Q2_K.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q2_K.gguf) | Q2_K | 23.71GB |\n| [Swallow-70b-NVE-instruct-hf.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.IQ3_XS.gguf) | IQ3_XS | 26.37GB |\n| [Swallow-70b-NVE-instruct-hf.IQ3_S.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.IQ3_S.gguf) | IQ3_S | 27.86GB |\n| [Swallow-70b-NVE-instruct-hf.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q3_K_S.gguf) | Q3_K_S | 27.86GB |\n| [Swallow-70b-NVE-instruct-hf.IQ3_M.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.IQ3_M.gguf) | IQ3_M | 28.82GB |\n| [Swallow-70b-NVE-instruct-hf.Q3_K.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q3_K.gguf) | Q3_K | 30.99GB |\n| [Swallow-70b-NVE-instruct-hf.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q3_K_M.gguf) | Q3_K_M | 30.99GB |\n| [Swallow-70b-NVE-instruct-hf.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q3_K_L.gguf) | Q3_K_L | 33.67GB |\n| [Swallow-70b-NVE-instruct-hf.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.IQ4_XS.gguf) | IQ4_XS | 34.64GB |\n| [Swallow-70b-NVE-instruct-hf.Q4_0.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q4_0.gguf) | Q4_0 | 36.2GB |\n| [Swallow-70b-NVE-instruct-hf.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.IQ4_NL.gguf) | IQ4_NL | 36.55GB |\n| [Swallow-70b-NVE-instruct-hf.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/blob/main/Swallow-70b-NVE-instruct-hf.Q4_K_S.gguf) | Q4_K_S | 36.55GB |\n| [Swallow-70b-NVE-instruct-hf.Q4_K.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q4_K | 38.58GB |\n| [Swallow-70b-NVE-instruct-hf.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q4_K_M | 38.58GB |\n| [Swallow-70b-NVE-instruct-hf.Q4_1.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q4_1 | 40.2GB |\n| [Swallow-70b-NVE-instruct-hf.Q5_0.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q5_0 | 44.2GB |\n| [Swallow-70b-NVE-instruct-hf.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q5_K_S | 44.2GB |\n| [Swallow-70b-NVE-instruct-hf.Q5_K.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q5_K | 45.41GB |\n| [Swallow-70b-NVE-instruct-hf.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q5_K_M | 45.41GB |\n| [Swallow-70b-NVE-instruct-hf.Q5_1.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q5_1 | 48.2GB |\n| [Swallow-70b-NVE-instruct-hf.Q6_K.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q6_K | 52.7GB |\n| [Swallow-70b-NVE-instruct-hf.Q8_0.gguf](https://huggingface.co/RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf/tree/main/) | Q8_0 | 68.26GB |\n\n\n\n\nOriginal model description:\n---\nlanguage:\n - en\n - ja\nlibrary_name: transformers\npipeline_tag: text-generation\nlicense: llama2\nmodel_type: llama\n---\n\n# Swallow\n\nOur Swallow model has undergone continual pre-training from the [Llama 2 family](https://huggingface.co/meta-llama), primarily with the addition of Japanese language data. The tuned versions use supervised fine-tuning (SFT). \nLinks to other models can be found in the index.\n\n# Model Release Updates\n\nWe are excited to share the release schedule for our latest models:\n- **April 26, 2024**: Released version 0.1 of our enhanced instruction-tuned models: [Swallow-7b-instruct-v0.1](https://huggingface.co/tokyotech-llm/Swallow-7b-instruct-v0.1), [Swallow-13b-instruct-v0.1](https://huggingface.co/tokyotech-llm/Swallow-13b-instruct-v0.1), and [Swallow-70b-instruct-v0.1](https://huggingface.co/tokyotech-llm/Swallow-70b-instruct-v0.1) as preview versions.\n- **March 2, 2024**: Released the [Swallow-7b-plus-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-plus-hf), a model trained with approximately twice as many Japanese tokens as [Swallow-7b-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-hf).\n- **February 4, 2024**: Released the [Swallow-13b-NVE-hf](https://huggingface.co/tokyotech-llm/Swallow-13b-NVE-hf).\n- **January 26, 2024**: Released the [Swallow-7b-NVE-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-NVE-hf), [Swallow-7b-NVE-instruct-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-NVE-instruct-hf), [Swallow-70b-NVE-hf](https://huggingface.co/tokyotech-llm/Swallow-70b-NVE-hf), and [Swallow-70b-NVE-instruct-hf](https://huggingface.co/tokyotech-llm/Swallow-70b-NVE-instruct-hf)\n- **December 19, 2023**: Released the [Swallow-7b-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-hf), [Swallow-7b-instruct-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-instruct-hf), [Swallow-13b-hf](https://huggingface.co/tokyotech-llm/Swallow-13b-hf), [Swallow-13b-instruct-hf](https://huggingface.co/tokyotech-llm/Swallow-13b-instruct-hf), [Swallow-70b-hf](https://huggingface.co/tokyotech-llm/Swallow-70b-hf), and [Swallow-70b-instruct-hf](https://huggingface.co/tokyotech-llm/Swallow-70b-instruct-hf).\n\n## Swallow Model Index\n|Model|Swallow-hf|Swallow-instruct-hf|Swallow-instruct-v0.1|\n|---|---|---|---|\n|7B| [Link](https://huggingface.co/tokyotech-llm/Swallow-7b-hf) | [Link](https://huggingface.co/tokyotech-llm/Swallow-7b-instruct-hf)|[Link](https://huggingface.co/tokyotech-llm/Swallow-7b-instruct-v1.0)|\n|7B-Plus| [Link](https://huggingface.co/tokyotech-llm/Swallow-7b-plus-hf) | N/A | N/A |\n|13B| [Link](https://huggingface.co/tokyotech-llm/Swallow-13b-hf) | [Link](https://huggingface.co/tokyotech-llm/Swallow-13b-instruct-hf)| [Link](https://huggingface.co/tokyotech-llm/Swallow-13b-instruct-v1.0)|\n|70B| [Link](https://huggingface.co/tokyotech-llm/Swallow-70b-hf) | [Link](https://huggingface.co/tokyotech-llm/Swallow-70b-instruct-hf)| [Link](https://huggingface.co/tokyotech-llm/Swallow-70b-instruct-v1.0)|\n\n## Swallow Model Index NVE (No Vocabulary Expansion)\n|Model|Swallow-NVE-hf|Swallow-NVE-instruct-hf|\n|---|---|---|\n|7B| [Link](https://huggingface.co/tokyotech-llm/Swallow-7b-NVE-hf) | [Link](https://huggingface.co/tokyotech-llm/Swallow-7b-NVE-instruct-hf)|\n|13B| [Link](https://huggingface.co/tokyotech-llm/Swallow-13b-NVE-hf) | N/A |\n|70B| [Link](https://huggingface.co/tokyotech-llm/Swallow-70b-NVE-hf) | [Link](https://huggingface.co/tokyotech-llm/Swallow-70b-NVE-instruct-hf)|\n\n\n\nThis repository provides large language models developed by [TokyoTech-LLM](https://tokyotech-llm.github.io/).\nRead our [blog post](https://zenn.dev/tokyotech_lm/articles/d6cb3a8fdfc907) or our [paper](https://arxiv.org/abs/2404.17790)\n\n## Model Details\n\n* **Model type**: Please refer to LLaMA-2 technical report for details on the model architecture. \n* **Language(s)**: Japanese English\n* **Library**: [Megatron-LM](https://github.com/rioyokotalab/Megatron-Llama2) \n* **Tokenizer**: This model employs a tokenizer that features a broadened vocabulary based on Japanese data. This allows for a more efficient representation of text using fewer tokens, leading to a notably faster inference process.\n* **Contact**: swallow[at]nlp.c.titech.ac.jp \n\n## Base Model Performance\n\n### Japanese tasks\n\n|Model|Size|JCommonsenseQA|JEMHopQA|NIILC|JSQuAD|XL-Sum|MGSM|WMT20-en-ja|WMT20-ja-en|\n|---|---|---|---|---|---|---|---|---|---|\n| | |4-shot|4-shot|4-shot|4-shot|1-shot|4-shot|4-shot|4-shot|\n| Llama 2 | 7B | 0.3852 | 0.4240 | 0.3410 | 0.7917 | 0.1905 | 0.0760 | 0.1783 | 0.1738 |\n| Swallow | 7B | 0.4808 | 0.5078 | 0.5968 | 0.8573 | 0.1830 | 0.1240 | 0.2510 | 0.1511 |\n| Swallow-Plus | 7B | 0.5478 | 0.5493 | 0.6030 | 0.8544 | 0.1806 | 0.1360 | 0.2568 | 0.1441 |\n| Swallow-NVE | 7B | 0.5433 | 0.5425 | 0.5729 | 0.8684 | 0.2117 | 0.1200 | 0.2405 | 0.1512 |\n| Llama 2 | 13B | 0.6997 | 0.4415 | 0.4170 | 0.8533 | 0.2139 | 0.1320 | 0.2146 | 0.1982 |\n| Swallow | 13B | 0.7837 | 0.5063 | 0.6398 | 0.9005 | 0.2168 | 0.2040 | 0.2720 | 0.1771 |\n| Swallow-NVE | 13B | 0.7712 | 0.5438 | 0.6351 | 0.9030 | 0.2294 | 0.2120 | 0.2735 | 0.1817 |\n| Llama 2 | 70B | 0.8686 | 0.4656 | 0.5256 | 0.9080 | 0.2361 | 0.3560 | 0.2643 | **0.2398** |\n| Swallow | 70B | 0.9348 | **0.6290** | 0.6960 | 0.9176 | 0.2266 | **0.4840** | **0.3043** | 0.2298 |\n| Swallow-NVE | 70B | **0.9410** | 0.5759 | **0.7024** | **0.9254** | **0.2758** | 0.4720 | 0.3042 | 0.2322 |\n### English tasks\n\n|Model|Size|OpenBookQA|TriviaQA|HellaSwag|SQuAD2.0|XWINO|GSM8K|\n|---|---|---|---|---|---|---|---|\n| | |8-shot|8-shot|8-shot|8-shot|8-shot|8-shot|\n| Llama 2 | 7B | 0.3580 | 0.6265 | 0.5860 | 0.3207 | 0.9049 | 0.1410 |\n| Swallow | 7B | 0.3180 | 0.4836 | 0.5308 | 0.3125 | 0.8817 | 0.1130 |\n| Swallow-Plus | 7B | 0.3280 | 0.4558 | 0.5259 | 0.3134 | 0.8929 | 0.1061 |\n| Swallow-NVE | 7B | 0.3180 | 0.5079 | 0.5329 | 0.2919 | 0.8817 | 0.0986 |\n| Llama 2 | 13B | 0.3760 | 0.7255 | 0.6148 | 0.3681 | 0.9140 | 0.2403 |\n| Swallow | 13B | 0.3500 | 0.5852 | 0.5660 | 0.3406 | 0.9075 | 0.2039 |\n| Swallow-NVE | 13B | 0.3460 | 0.6025 | 0.5700 | 0.3478 | 0.9006 | 0.1751 |\n| Llama 2 | 70B | **0.4280** | **0.8239** | **0.6742** | **0.3770** | **0.9290** | **0.5284** |\n| Swallow | 70B | 0.4220 | 0.7756 | 0.6458 | 0.3745 | 0.9204 | 0.4867 |\n| Swallow-NVE | 70B | 0.4240 | 0.7817 | 0.6439 | 0.3451 | 0.9256 | 0.4943 |\n\n## Evaluation Benchmarks\n\n### Japanese evaluation benchmarks\n\nWe used llm-jp-eval(v1.0.0) and JP Language Model Evaluation Harness(commit #9b42d41). The details are as follows:\n\n- Multiple-choice question answering (JCommonsenseQA [Kurihara+, 2022])\n- Open-ended question answering (JEMHopQA [Ishii+, 2023])\n- Open-ended question answering (NIILC [Sekine, 2003])\n- Machine reading comprehension (JSQuAD [Kurihara+, 2022])\n- Automatic summarization (XL-Sum [Hasan+, 2021])\n- Machine translation (WMT2020 ja-en [Barrault+, 2020])\n- Machine translation (WMT2020 en-ja [Barrault+, 2020])\n- Mathematical reasoning (MGSM [Shi+, 2023])\n\n### English evaluation benchmarks\n\nWe used the Language Model Evaluation Harness(v.0.3.0). The details are as follows:\n\n- Multiple-choice question answering (OpenBookQA [Mihaylov+, 2018])\n- Open-ended question answering (TriviaQA [Joshi+, 2017])\n- Machine reading comprehension (SQuAD 2.0 [Rajpurkar+, 2018])\n- Commonsense reasoning (XWINO [Tikhonov & Ryabinin, 2021])\n- Natural language inference (HellaSwag [Zellers+, 2019])\n- Mathematical reasoning (GSM8k [Cobbe+, 2021])\n\n\n## Usage\n\nFirst install additional dependencies in [requirements.txt](./requirements.txt):\n\n```sh\npip install -r requirements.txt\n```\n\n### Use the instruct model\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\n\nmodel_name = \"tokyotech-llm/Swallow-7b-instruct-hf\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, low_cpu_mem_usage=True, device_map=\"auto\")\n\n\nPROMPT_DICT = {\n \"prompt_input\": (\n \"以下に、あるタスクを説明する指示があり、それに付随する入力が更なる文脈を提供しています。\"\n \"リクエストを適切に完了するための回答を記述してください。\\n\\n\"\n \"### 指示:\\n{instruction}\\n\\n### 入力:\\n{input}\\n\\n### 応答:\"\n\n ),\n \"prompt_no_input\": (\n \"以下に、あるタスクを説明する指示があります。\"\n \"リクエストを適切に完了するための回答を記述してください。\\n\\n\"\n \"### 指示:\\n{instruction}\\n\\n### 応答:\"\n ),\n}\n\ndef create_prompt(instruction, input=None):\n \"\"\"\n Generates a prompt based on the given instruction and an optional input.\n If input is provided, it uses the 'prompt_input' template from PROMPT_DICT.\n If no input is provided, it uses the 'prompt_no_input' template.\n\n Args:\n instruction (str): The instruction describing the task.\n input (str, optional): Additional input providing context for the task. Default is None.\n\n Returns:\n str: The generated prompt.\n \"\"\"\n if input:\n # Use the 'prompt_input' template when additional input is provided\n return PROMPT_DICT[\"prompt_input\"].format(instruction=instruction, input=input)\n else:\n # Use the 'prompt_no_input' template when no additional input is provided\n return PROMPT_DICT[\"prompt_no_input\"].format(instruction=instruction)\n\n# Example usage\ninstruction_example = \"以下のトピックに関する詳細な情報を提供してください。\"\ninput_example = \"東京工業大学の主なキャンパスについて教えてください\"\nprompt = create_prompt(instruction_example, input_example)\n\ninput_ids = tokenizer.encode(\n prompt,\n add_special_tokens=False,\n return_tensors=\"pt\"\n)\n\ntokens = model.generate(\n input_ids.to(device=model.device),\n max_new_tokens=128,\n temperature=0.99,\n top_p=0.95,\n do_sample=True,\n)\n\nout = tokenizer.decode(tokens[0], skip_special_tokens=True)\nprint(out)\n\n```\n\n### Use the base model\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\n\nmodel_name = \"tokyotech-llm/Swallow-7b-hf\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map=\"auto\")\n\nprompt = \"東京工業大学の主なキャンパスは、\"\ninput_ids = tokenizer.encode(\n prompt,\n add_special_tokens=False,\n return_tensors=\"pt\"\n)\ntokens = model.generate(\n input_ids.to(device=model.device),\n max_new_tokens=128,\n temperature=0.99,\n top_p=0.95,\n do_sample=True,\n)\n\nout = tokenizer.decode(tokens[0], skip_special_tokens=True)\nprint(out)\n```\n\n## Training Datasets\n\n### Continual Pre-Training\nThe following datasets were used for continual pre-training.\n\n- [Japanese Wikipedia](https://dumps.wikimedia.org/other/cirrussearch)\n- [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)\n- [Swallow Corpus](https://arxiv.org/abs/2404.17733)\n- [The Pile](https://huggingface.co/datasets/EleutherAI/pile)\n\n\n### Instruction Tuning\n\nThe following datasets were used for the instruction tuning. \n\n- [Anthropic HH-RLHF](https://huggingface.co/datasets/kunishou/hh-rlhf-49k-ja)\n- [Databricks Dolly 15-k](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)\n- [OpenAssistant Conversations Dataset](https://huggingface.co/datasets/kunishou/oasst1-89k-ja)\n \n## Risks and Limitations\n\nThe models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.\n\n## Acknowledgements\n\nWe thank Meta Research for releasing Llama 2 under an open license for others to build on.\n\nOur project is supported by the [ABCI Large-scale Language Model Building Support Program](https://abci.ai/en/link/llm_support_program.html) of the National Institute of Advanced Industrial Science and Technology. \n\n## License\n\nLlama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.\n\n## Authors\n\nHere are the team members:\n- From [Okazaki Laboratory](https://www.nlp.c.titech.ac.jp/index.en.html), the following members:\n - [Naoaki Okazaki](https://www.chokkan.org/index.ja.html)\n - [Sakae Mizuki](https://s-mizuki-nlp.github.io/)\n - [Hiroki Iida](https://meshidenn.github.io/)\n - [Mengsay Loem](https://loem-ms.github.io/)\n - [Shota Hirai](https://huggingface.co/Kotemo428)\n - [Kakeru Hattori](https://aya-se.vercel.app/)\n - [Masanari Ohi](https://twitter.com/stjohn2007)\n- From [YOKOTA Laboratory](https://www.rio.gsic.titech.ac.jp/en/index.html), the following members:\n - [Rio Yokota](https://twitter.com/rioyokota)\n - [Kazuki Fujii](https://twitter.com/okoge_kaz)\n - [Taishi Nakamura](https://twitter.com/Setuna7777_2)\n\n## How to cite\n```\n@misc{fujii2024continual,\n title={Continual Pre-Training for Cross-Lingual LLM Adaptation: Enhancing Japanese Language Capabilities}, \n author={Kazuki Fujii and Taishi Nakamura and Mengsay Loem and Hiroki Iida and Masanari Ohi and Kakeru Hattori and Hirai Shota and Sakae Mizuki and Rio Yokota and Naoaki Okazaki},\n year={2024},\n eprint={2404.17790},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n```\n\n",
"related_quantizations": []
},
"tags": [
"gguf",
"arxiv:2404.17790",
"arxiv:2404.17733",
"endpoints_compatible",
"region:us"
],
"likes": 0,
"downloads": 186,
"gated": false,
"private": false,
"last_modified": "2024-07-19T00:37:20.000Z",
"created_at": "2024-07-17T18:58:25.000Z",
"pipeline_tag": "",
"library_name": ""
}
Source payload excerpt (from Hugging Face API)
{
"_id": "66981451e31162d4a364e65f",
"id": "RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf",
"modelId": "RichardErkhov/tokyotech-llm_-_Swallow-70b-NVE-instruct-hf-gguf",
"sha": "4a65799b394b389c23d7d83d050607321f38bf9b",
"createdAt": "2024-07-17T18:58:25.000Z",
"lastModified": "2024-07-19T00:37:20.000Z",
"author": "RichardErkhov",
"downloads": 186,
"likes": 0,
"gated": false,
"private": false,
"pipeline_tag": "",
"library_name": "",
"siblings_count": 34
}