Views
No views yet
pip install nm-vllm[sparse]1from transformers import AutoTokenizer
2from vllm import LLM, SamplingParams
3
4model_id = "neuralmagic/OpenHermes-2.5-Mistral-7B-marlin"
5model = LLM(model_id)
6
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8messages = [
9 {"role": "user", "content": "What is synthetic data in machine learning?"},
10]
11formatted_prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12sampling_params = SamplingParams(max_tokens=200)
13outputs = model.generate(formatted_prompt, sampling_params=sampling_params)
14print(outputs[0].outputs[0].text)
15
16"""
17Synthetic data is data that has been artificially created or modified to serve the needs of machine learning and data analysis tasks. It can be generated either through title methods like stochastic simulations or through processes of data augmentation that take original data and modify/manipulate it to create new samples. Synthetic data is often used in machine learning when the available amount of real-world data is insufficient or in cases where the creation of real-world data can be dangerous, costly, or time-consuming.
18"""quantization/apply_gptq_save_marlin.py script:1pip install -r quantization/requirements.txt
2python3 quantization/apply_gptq_save_marlin.py --model-id teknium/OpenHermes-2.5-Mistral-7B --save-dir ./openhermes-marlin