AminFaraji commited on
Commit
1af7717
·
verified ·
1 Parent(s): 77a3315

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -94,7 +94,10 @@ db = Chroma(persist_directory=CHROMA_PATH, embedding_function=embeddings)
94
  MODEL_NAME = "gpt2"
95
 
96
  model = AutoModelForCausalLM.from_pretrained(
97
- MODEL_NAME, trust_remote_code=True, device_map="auto",offload_folder="offload"
 
 
 
98
  )
99
  model = model.eval()
100
 
 
94
  MODEL_NAME = "gpt2"
95
 
96
  model = AutoModelForCausalLM.from_pretrained(
97
+ "gpt2",
98
+ device_map="auto",
99
+ low_cpu_mem_usage=True,
100
+ torch_dtype=torch.float16 # Use float16 to reduce memory usage
101
  )
102
  model = model.eval()
103