Spaces:
Build error
Build error
solve custom code issue with workaround
Browse files- langchainapp.py +3 -3
langchainapp.py
CHANGED
@@ -40,11 +40,11 @@ os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
|
|
40 |
os.environ['CUDA_CACHE_DISABLE'] = '1'
|
41 |
|
42 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
43 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name, token=token, trust_remote_code=True)
|
44 |
-
nvidiamodel = AutoModel.from_pretrained(model_name, token=token, trust_remote_code=True).to(device)
|
45 |
### Utils
|
46 |
hf_token, yi_token = load_env_variables()
|
47 |
-
|
|
|
|
|
48 |
def clear_cuda_cache():
|
49 |
torch.cuda.empty_cache()
|
50 |
|
|
|
40 |
os.environ['CUDA_CACHE_DISABLE'] = '1'
|
41 |
|
42 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
|
43 |
### Utils
|
44 |
hf_token, yi_token = load_env_variables()
|
45 |
+
|
46 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, token=hf_token, trust_remote_code=True)
|
47 |
+
nvidiamodel = AutoModel.from_pretrained(model_name, token=hf_token, trust_remote_code=True).to(device)
|
48 |
def clear_cuda_cache():
|
49 |
torch.cuda.empty_cache()
|
50 |
|