Views
No views yet
pip install nm-vllm[sparse]1from transformers import AutoTokenizer
2from vllm import LLM, SamplingParams
3
4model_id = "softmax/Llama-2-70b-chat-hf-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"""
17 Synthetic data, also known as artificial data or simulated data, is data that is artificially generated using various methods, rather than being collected from real-world sources. Synthetic data can be used to augment or substitute real-world data in machine learning applications, and can be particularly useful when real-world data is limited, expensive, or difficult to obtain.
18
19There are several ways to generate synthetic data, including:
20
211. Data augmentation: This involves transforming existing data, such as images or time series data, to create new data that can be used to augment a training set. For example, an image recognition model can be trained on a dataset of images that have been rotated, scaled, and flipped to create new images that the model has not seen before.
222. Generative models: These models use algorithms to generate new data that resembles real-world data. Generative adversarial networks (GAN
23"""