added init for spaces and removed comment for @spaces
Browse files
app.py
CHANGED
|
@@ -7,6 +7,9 @@ from threading import Thread
|
|
| 7 |
from openai import OpenAI
|
| 8 |
import spaces
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
TOKEN = os.getenv('HF_AUTH_TOKEN')
|
| 11 |
login(token=TOKEN,
|
| 12 |
add_to_git_credential=False)
|
|
@@ -74,7 +77,7 @@ def gpt_generation(input: str,
|
|
| 74 |
return stream
|
| 75 |
|
| 76 |
# Place just input pass and return generation output
|
| 77 |
-
|
| 78 |
def llama_generation(input_text: str,
|
| 79 |
history: list,
|
| 80 |
temperature: float,
|
|
|
|
| 7 |
from openai import OpenAI
|
| 8 |
import spaces
|
| 9 |
|
| 10 |
+
# Init ZeroGPU
|
| 11 |
+
spaces.initialize_zero_gpu()
|
| 12 |
+
|
| 13 |
TOKEN = os.getenv('HF_AUTH_TOKEN')
|
| 14 |
login(token=TOKEN,
|
| 15 |
add_to_git_credential=False)
|
|
|
|
| 77 |
return stream
|
| 78 |
|
| 79 |
# Place just input pass and return generation output
|
| 80 |
+
@spaces.GPU(duration=120)
|
| 81 |
def llama_generation(input_text: str,
|
| 82 |
history: list,
|
| 83 |
temperature: float,
|