Update interface.py
Browse files- interface.py +2 -0
interface.py
CHANGED
|
@@ -18,6 +18,8 @@ model_path = MODEL_PATH
|
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 19 |
model = AutoModelForCausalLM.from_pretrained(model_path).to(device).eval()
|
| 20 |
|
|
|
|
|
|
|
| 21 |
def generate_analysis(prompt, max_length=MAX_LENGTH):
|
| 22 |
try:
|
| 23 |
input_ids = tokenizer.encode(prompt, return_tensors='pt').to(device)
|
|
|
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 19 |
model = AutoModelForCausalLM.from_pretrained(model_path).to(device).eval()
|
| 20 |
|
| 21 |
+
from decorators import spaces
|
| 22 |
+
@spaces.GPU(duration=100)
|
| 23 |
def generate_analysis(prompt, max_length=MAX_LENGTH):
|
| 24 |
try:
|
| 25 |
input_ids = tokenizer.encode(prompt, return_tensors='pt').to(device)
|