Views
No views yet
bfloat16 precision you need approximately 8xA100 80GB or equivalent.1from transformers import AutoTokenizer, AutoModelForCausalLM
2import transformers
3import torch
4
5model = "quantumaikr/falcon-180B-WizardLM_Orca"
6
7tokenizer = AutoTokenizer.from_pretrained(model)
8pipeline = transformers.pipeline(
9 "text-generation",
10 model=model,
11 tokenizer=tokenizer,
12 torch_dtype=torch.bfloat16,
13 trust_remote_code=True,
14 device_map="auto",
15)
16sequences = pipeline(
17 "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
18 max_length=200,
19 do_sample=True,
20 top_k=10,
21 num_return_sequences=1,
22 eos_token_id=tokenizer.eos_token_id,
23)
24for seq in sequences:
25 print(f"Result: {seq['generated_text']}")
26