tloen commited on
Commit
b27f6c7
1 Parent(s): 7563f17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -10,6 +10,11 @@ from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
10
 
11
  tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
12
 
 
 
 
 
 
13
  model = LlamaForCausalLM.from_pretrained(
14
  "decapoda-research/llama-7b-hf",
15
  load_in_8bit=True,
 
10
 
11
  tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
12
 
13
+ if torch.cuda.is_available():
14
+ device = "cuda"
15
+ else:
16
+ device = "cpu"
17
+
18
  model = LlamaForCausalLM.from_pretrained(
19
  "decapoda-research/llama-7b-hf",
20
  load_in_8bit=True,