Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
-
import torch
|
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(f'zero.device: {zero.device}') # <-- 'cpu' 🤔
|
10 |
|
11 |
@spaces.GPU
|
12 |
def greet(n):
|
13 |
global llm
|
14 |
llm = load_model(download_model())
|
15 |
|
16 |
-
print(f'zero.device: {zero.device}') # <-- 'cuda:0' 🤗
|
17 |
grammar = LlamaGrammar.from_string('''
|
18 |
root ::= sentence
|
19 |
answer ::= (weather | complaint | yesno | gen)
|
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
+
# import torch
|
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(f'zero.device: {zero.device}') # <-- 'cpu' 🤔
|
10 |
|
11 |
@spaces.GPU
|
12 |
def greet(n):
|
13 |
global llm
|
14 |
llm = load_model(download_model())
|
15 |
|
16 |
+
# print(f'zero.device: {zero.device}') # <-- 'cuda:0' 🤗
|
17 |
grammar = LlamaGrammar.from_string('''
|
18 |
root ::= sentence
|
19 |
answer ::= (weather | complaint | yesno | gen)
|