TheBloke commited on
Commit
1118331
1 Parent(s): ac05c74

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md CHANGED
@@ -350,4 +350,35 @@ parameters:
350
  dtype: bfloat16
351
  ```
352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  <!-- original-model-card end -->
 
350
  dtype: bfloat16
351
  ```
352
 
353
+ ## 💻 Usage
354
+
355
+ ```python
356
+ !pip install -qU transformers accelerate
357
+
358
+ from transformers import AutoTokenizer
359
+ import transformers
360
+ import torch
361
+
362
+ model = "mlabonne/NeuralPipe-7B-slerp"
363
+ messages = [{"role": "user", "content": "What is a large language model?"}]
364
+
365
+ tokenizer = AutoTokenizer.from_pretrained(model)
366
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
367
+ pipeline = transformers.pipeline(
368
+ "text-generation",
369
+ model=model,
370
+ torch_dtype=torch.float16,
371
+ device_map="auto",
372
+ )
373
+
374
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
375
+ print(outputs[0]["generated_text"])
376
+ ```
377
+
378
+ Output:
379
+
380
+ ```
381
+ A large language model is an AI system that uses deep learning techniques to process and understand vast amounts of natural language data. It is designed to generate human-like text, perform complex language tasks, and understand the context, nuance, and meaning of textual data. These models are trained on large datasets, often including billions of words, to learn the patterns and relationships in language. As a result, they can generate coherent and contextually relevant text, answer questions, and perform a variety of other language-related tasks. Some well-known large language models include OpenAI's GPT-3, Google's BERT, and Facebook's RoBERTa.
382
+ ```
383
+
384
  <!-- original-model-card end -->