Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -9,15 +9,15 @@ print(zero.device) # <-- 'cpu' 🤔
|
|
9 |
@spaces.GPU
|
10 |
def greet(n):
|
11 |
print(zero.device) # <-- 'cuda:0' 🤗
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
prompts = [
|
23 |
"How's the weather in London?",
|
|
|
9 |
@spaces.GPU
|
10 |
def greet(n):
|
11 |
print(zero.device) # <-- 'cuda:0' 🤗
|
12 |
+
grammar = LlamaGrammar.from_string('''
|
13 |
+
root ::= sentence
|
14 |
+
answer ::= (weather | complaint | yesno | gen)
|
15 |
+
weather ::= ("Sunny." | "Cloudy." | "Rainy.")
|
16 |
+
complaint ::= "I don't like talking about the weather."
|
17 |
+
yesno ::= ("Yes." | "No.")
|
18 |
+
gen ::= "1. " [A-Z] [a-z] [a-z]*
|
19 |
+
sentence ::= [A-Z] [A-Za-z0-9 ,-]* ("." | "!" | "?")
|
20 |
+
''')
|
21 |
|
22 |
prompts = [
|
23 |
"How's the weather in London?",
|