HedronCreeper commited on
Commit
0b6ff79
·
verified ·
1 Parent(s): ed2b95d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -7,8 +7,8 @@ model_id = "google/gemma-4-E2B"
7
  tokenizer = AutoTokenizer.from_pretrained(model_id)
8
  model = AutoModelForCausalLM.from_pretrained(
9
  model_id,
10
- device_map="auto",
11
- torch_dtype=torch.float32,
12
  low_cpu_mem_usage=True
13
  )
14
 
@@ -16,6 +16,7 @@ pipe = pipeline(
16
  "text-generation",
17
  model=model,
18
  tokenizer=tokenizer,
 
19
  )
20
 
21
  def predict(message, history):
 
7
  tokenizer = AutoTokenizer.from_pretrained(model_id)
8
  model = AutoModelForCausalLM.from_pretrained(
9
  model_id,
10
+ device_map={"": "cpu"},
11
+ dtype=torch.float32,
12
  low_cpu_mem_usage=True
13
  )
14
 
 
16
  "text-generation",
17
  model=model,
18
  tokenizer=tokenizer,
19
+ device="cpu"
20
  )
21
 
22
  def predict(message, history):