Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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,
|