added spaces decoration on generation
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ from huggingface_hub import login
|
|
| 5 |
import os
|
| 6 |
from threading import Thread
|
| 7 |
from openai import OpenAI
|
| 8 |
-
|
| 9 |
|
| 10 |
TOKEN = os.getenv('HF_AUTH_TOKEN')
|
| 11 |
login(token=TOKEN,
|
|
@@ -74,6 +74,7 @@ def gpt_generation(input: str,
|
|
| 74 |
return stream
|
| 75 |
|
| 76 |
# Place just input pass and return generation output
|
|
|
|
| 77 |
def llama_generation(input_text: str,
|
| 78 |
history: list,
|
| 79 |
temperature: float,
|
|
|
|
| 5 |
import os
|
| 6 |
from threading import Thread
|
| 7 |
from openai import OpenAI
|
| 8 |
+
import spaces
|
| 9 |
|
| 10 |
TOKEN = os.getenv('HF_AUTH_TOKEN')
|
| 11 |
login(token=TOKEN,
|
|
|
|
| 74 |
return stream
|
| 75 |
|
| 76 |
# Place just input pass and return generation output
|
| 77 |
+
@spaces.GPU(duration=120)
|
| 78 |
def llama_generation(input_text: str,
|
| 79 |
history: list,
|
| 80 |
temperature: float,
|