Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
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 |
|