Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,8 @@ print(f'zero.device: {zero.device}') # <-- 'cpu' 🤔
|
|
11 |
@spaces.GPU
|
12 |
def greet(n):
|
13 |
global llm
|
|
|
|
|
14 |
print(f'zero.device: {zero.device}') # <-- 'cuda:0' 🤗
|
15 |
grammar = LlamaGrammar.from_string('''
|
16 |
root ::= sentence
|
@@ -66,7 +68,6 @@ def load_model(fp):
|
|
66 |
)
|
67 |
return llm
|
68 |
|
69 |
-
llm = load_model(download_model())
|
70 |
print(f'llm: {llm}')
|
71 |
demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
|
72 |
demo.launch(share=False)
|
|
|
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
|
|
|
68 |
)
|
69 |
return llm
|
70 |
|
|
|
71 |
print(f'llm: {llm}')
|
72 |
demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
|
73 |
demo.launch(share=False)
|