Views
No views yet
pip install hf-hub-ctranslate2>=2.0.8 ctranslate2>=3.14.0ct2-transformers-converter --model HuggingFaceH4/starchat-beta --output_dir /home/michael/tmp-ct2fast-starchat-beta --force --copy_files merges.txt all_results.json training_args.bin tokenizer.json README.md dialogue_template.json tokenizer_config.json eval_results.json vocab.json train_results.json generation_config.json trainer_state.json special_tokens_map.json added_tokens.json requirements.txt .gitattributes --quantization int8_float16 --trust_remote_codecompute_type=int8_float16 for device="cuda"compute_type=int8 for device="cpu"1from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
2from transformers import AutoTokenizer
3
4model_name = "michaelfeil/ct2fast-starchat-beta"
5# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
6model = GeneratorCT2fromHfHub(
7 # load in int8 on CUDA
8 model_name_or_path=model_name,
9 device="cuda",
10 compute_type="int8_float16",
11 # tokenizer=AutoTokenizer.from_pretrained("HuggingFaceH4/starchat-beta")
12)
13outputs = model.generate(
14 text=["def fibonnaci(", "User: How are you doing? Bot:"],
15 max_length=64,
16 include_prompt_in_result=False
17)
18print(outputs)
openassistant-guanaco dataset. We found that removing the in-built alignment of the OpenAssistant dataset boosted performance on the Open LLM Leaderboard and made the model more helpful at coding tasks. However, this means that model is likely to generate problematic text when prompted to do so and should only be used for educational and research purposes.openassistant-guanaco dataset.OpenAssistant/oasst1 dataset, which contains a diverse range of dialogues in over 35 languages. As a result, the model can be used for chat and you can check out our demo to test its coding capabilities.pipeline() function from 🤗 Transformers:1import torch
2from transformers import pipeline
3
4pipe = pipeline("text-generation", model="HuggingFaceH4/starchat-beta", torch_dtype=torch.bfloat16, device_map="auto")
5
6# We use a variant of ChatML to format each message
7prompt_template = "<|system|>\n<|end|>\n<|user|>\n{query}<|end|>\n<|assistant|>"
8prompt = prompt_template.format(query="How do I sort a list in Python?")
9# We use a special <|end|> token with ID 49155 to denote ends of a turn
10outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95, eos_token_id=49155)
11# You can sort a list in Python by using the sort() method. Here's an example:\n\n```\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\nnumbers.sort()\nprint(numbers)\n```\n\nThis will sort the list in place and print the sorted list.openassistant-guanaco dataset. We applied the same recipe used to filter the ShareGPT datasets behind the WizardLM.| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.5321 | 0.98 | 15 | 1.2856 |
| 1.2071 | 1.97 | 30 | 1.2620 |
| 1.0162 | 2.95 | 45 | 1.2853 |
| 0.8484 | 4.0 | 61 | 1.3274 |
| 0.6981 | 4.98 | 76 | 1.3994 |
| 0.5668 | 5.9 | 90 | 1.4720 |
@article{Tunstall2023starchat-alpha,
author = {Tunstall, Lewis and Lambert, Nathan and Rajani, Nazneen and Beeching, Edward and Le Scao, Teven and von Werra, Leandro and Han, Sheon and Schmid, Philipp and Rush, Alexander},
title = {Creating a Coding Assistant with StarCoder},
journal = {Hugging Face Blog},
year = {2023},
note = {https://huggingface.co/blog/starchat},
}