Coool2 commited on
Commit
22bd263
·
verified ·
1 Parent(s): 2ff3c3a

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +5 -0
agent.py CHANGED
@@ -24,6 +24,11 @@ from llama_index.core import Settings
24
  from transformers import AutoModelForCausalLM, AutoTokenizer
25
  from llama_index.llms.huggingface import HuggingFaceLLM
26
 
 
 
 
 
 
27
  model_id = "Qwen/Qwen2.5-14B-Instruct"
28
  proj_llm = HuggingFaceLLM(
29
  model_name=model_id,
 
24
  from transformers import AutoModelForCausalLM, AutoTokenizer
25
  from llama_index.llms.huggingface import HuggingFaceLLM
26
 
27
+ import torch
28
+
29
+ torch.cuda.set_per_process_memory_fraction(0.7, 0) # GPU 0: 70%
30
+ torch.cuda.set_per_process_memory_fraction(0.7, 1) # GPU 1: 70%
31
+
32
  model_id = "Qwen/Qwen2.5-14B-Instruct"
33
  proj_llm = HuggingFaceLLM(
34
  model_name=model_id,