Views
No views yet
Excellent question! The formula for calculating the area of a triangle is 1/2 times the base times the height. Remember, the base is the length of the bottom side, and the height is the perpendicular distance from the base to the opposite vertex. Let's work through an example together!Certainly! Gravity is the force that attracts objects towards each other. It's what keeps us grounded on Earth. Would you like me to give you some examples to help you understand it better?1pip install transformers==4.35.0
2pip install accelerate==0.23.0
3pip install flash_attn1from transformers import AutoModelForCausalLM, AutoTokenizer
2import transformers
3import torch
4
5model_id = "ibleducation/ibl-tutoring-7B-128k"
6
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8model = AutoModelForCausalLM.from_pretrained(
9 model_id,
10 use_flash_attention_2=True,
11 torch_dtype=torch.bfloat16,
12 device_map="auto",
13 trust_remote_code=True
14)
15pipeline = transformers.pipeline(
16 "text-generation",
17 model=model,
18 tokenizer=tokenizer,
19)
20prompt = "<s>What makes a good teacher?</s>"
21
22response = pipeline(prompt)
23print(response['generated_text'])In cases where the runtime gpu does not support flash attention,use_flash_attention_2can be ignored though at a possible performance cost
<s>{prompt}</s>