Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,13 @@ import torch
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
from llama_cpp import Llama, LlamaGrammar
|
6 |
|
|
|
7 |
zero = torch.Tensor([0]).cuda()
|
8 |
print(zero.device) # <-- 'cpu' 🤔
|
9 |
|
10 |
@spaces.GPU
|
11 |
-
def greet(
|
|
|
12 |
print(zero.device) # <-- 'cuda:0' 🤗
|
13 |
grammar = LlamaGrammar.from_string('''
|
14 |
root ::= sentence
|
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
from llama_cpp import Llama, LlamaGrammar
|
6 |
|
7 |
+
|
8 |
zero = torch.Tensor([0]).cuda()
|
9 |
print(zero.device) # <-- 'cpu' 🤔
|
10 |
|
11 |
@spaces.GPU
|
12 |
+
def greet(n):
|
13 |
+
global llm
|
14 |
print(zero.device) # <-- 'cuda:0' 🤗
|
15 |
grammar = LlamaGrammar.from_string('''
|
16 |
root ::= sentence
|