YOUSEF2434 commited on
Commit
cda8406
·
verified ·
1 Parent(s): 8d0df65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -16,12 +16,12 @@ if not os.path.exists(MODEL_PATH):
16
  f.write(chunk)
17
  print("Model downloaded.")
18
 
19
- # Load the model
20
  llm = Llama(
21
  model_path=MODEL_PATH,
22
- n_ctx=8192,
23
- n_threads=4,
24
- n_gpu_layers=20, # Adjust for HF GPU environment
25
  chat_format="chatml"
26
  )
27
 
@@ -40,4 +40,4 @@ def chat_interface(message, history):
40
  history.append((message, reply))
41
  return reply, history
42
 
43
- gr.ChatInterface(fn=chat_interface, title="Qwen3-4B Chat").launch()
 
16
  f.write(chunk)
17
  print("Model downloaded.")
18
 
19
+ # Load the model with adjustments for CPU
20
  llm = Llama(
21
  model_path=MODEL_PATH,
22
+ n_ctx=4096, # Reduced context window size
23
+ n_threads=2, # Reduced threads for CPU use
24
+ n_gpu_layers=0, # Set to 0 since we're using CPU
25
  chat_format="chatml"
26
  )
27
 
 
40
  history.append((message, reply))
41
  return reply, history
42
 
43
+ gr.ChatInterface(fn=chat_interface, title="Ministral 3B Chat").launch()