AthuKawale commited on
Commit
18d159f
·
1 Parent(s): a802987

changed for error libcuda.so

Browse files
Files changed (1) hide show
  1. app.py +2 -27
app.py CHANGED
@@ -9,31 +9,6 @@ dataset_name = "timdettmers/openassistant-guanaco"
9
  dataset = load_dataset(dataset_name, split="train")
10
 
11
 
12
- from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
13
-
14
- # quantizition configuration
15
- bnb_config = BitsAndBytesConfig(
16
- load_in_4bit=True,
17
- bnb_4bit_quant_type="nf4",
18
- bnb_4bit_compute_dtype=torch.float16,
19
- )
20
-
21
- # download model
22
-
23
- model_name = "TinyPixel/Llama-2-7B-bf16-sharded"
24
- model = AutoModelForCausalLM.from_pretrained(
25
- model_name,
26
- quantization_config=bnb_config,
27
- trust_remote_code=True
28
- )
29
- model.config.use_cache = False
30
-
31
- tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
32
- tokenizer.pad_token = tokenizer.eos_token
33
-
34
- text = "What is a large language model?"
35
- device = "cuda:0"
36
- inputs = tokenizer(text, return_tensors="pt").to(device)
37
- outputs = model.generate(**inputs, max_new_tokens=50)
38
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
39
 
 
9
  dataset = load_dataset(dataset_name, split="train")
10
 
11
 
12
+ echo $LD_LIBRARY_PATH #path
13
+ sudo find /usr/ -name 'libcuda.so.*' #version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14