Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -228,6 +228,8 @@ def construct_prompt(ticker, curday, n_weeks, use_basics):
|
|
228 |
|
229 |
|
230 |
def predict(ticker, date, n_weeks, use_basics):
|
|
|
|
|
231 |
|
232 |
info, prompt = construct_prompt(ticker, date, n_weeks, use_basics)
|
233 |
|
@@ -235,6 +237,8 @@ def predict(ticker, date, n_weeks, use_basics):
|
|
235 |
prompt, return_tensors='pt', padding=False
|
236 |
)
|
237 |
inputs = {key: value.to(model.device) for key, value in inputs.items()}
|
|
|
|
|
238 |
|
239 |
res = model.generate(
|
240 |
**inputs, max_length=4096, do_sample=True,
|
|
|
228 |
|
229 |
|
230 |
def predict(ticker, date, n_weeks, use_basics):
|
231 |
+
|
232 |
+
torch.cuda.empty_cache()
|
233 |
|
234 |
info, prompt = construct_prompt(ticker, date, n_weeks, use_basics)
|
235 |
|
|
|
237 |
prompt, return_tensors='pt', padding=False
|
238 |
)
|
239 |
inputs = {key: value.to(model.device) for key, value in inputs.items()}
|
240 |
+
|
241 |
+
print("Inputs loaded onto devices.")
|
242 |
|
243 |
res = model.generate(
|
244 |
**inputs, max_length=4096, do_sample=True,
|