enzer1992 commited on
Commit
ca2edf7
1 Parent(s): 186a56c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -10,10 +10,14 @@ args = dict(
10
  template="llama3",
11
  finetuning_type="lora",
12
  quantization_bit=4,
13
- device="cpu", # Forces CPU usage
14
  )
 
15
  chat_model = ChatModel(args)
16
 
 
 
 
 
17
  # Step 2: Create a function for chatting
18
  def chat(user_input, history):
19
  messages = history + [{"role": "user", "content": user_input}]
 
10
  template="llama3",
11
  finetuning_type="lora",
12
  quantization_bit=4,
 
13
  )
14
+
15
  chat_model = ChatModel(args)
16
 
17
+ # Force the model to CPU
18
+ device = torch.device("cpu")
19
+ chat_model.model.to(device)
20
+
21
  # Step 2: Create a function for chatting
22
  def chat(user_input, history):
23
  messages = history + [{"role": "user", "content": user_input}]