Update app.py
Browse files
app.py
CHANGED
|
@@ -65,10 +65,10 @@ class StarlingBot:
|
|
| 65 |
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
| 66 |
# response_text = response.split("<|assistant|>\n")[-1]
|
| 67 |
return response_text
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
|
| 73 |
starling_bot = StarlingBot()
|
| 74 |
|
|
|
|
| 65 |
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
| 66 |
# response_text = response.split("<|assistant|>\n")[-1]
|
| 67 |
return response_text
|
| 68 |
+
finally:
|
| 69 |
+
del input_ids, attention_mask, output_ids
|
| 70 |
+
gc.collect()
|
| 71 |
+
torch.cuda.empty_cache()
|
| 72 |
|
| 73 |
starling_bot = StarlingBot()
|
| 74 |
|