rodrigomasini commited on
Commit
084a525
1 Parent(s): 59bf219

Update app_v1.py

Browse files
Files changed (1) hide show
  1. app_v1.py +7 -1
app_v1.py CHANGED
@@ -3,7 +3,13 @@ from transformers import AutoTokenizer
3
  from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
4
  from huggingface_hub import snapshot_download
5
  import os
6
- import threading
 
 
 
 
 
 
7
 
8
  cwd = os.getcwd()
9
  cachedir = cwd + '/cache'
 
3
  from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
4
  from huggingface_hub import snapshot_download
5
  import os
6
+ import torch
7
+
8
+ # Clear up some memory
9
+ torch.cuda.empty_cache()
10
+
11
+ # Try reducing the number of threads PyTorch uses
12
+ torch.set_num_threads(1)
13
 
14
  cwd = os.getcwd()
15
  cachedir = cwd + '/cache'