zmeeks commited on
Commit
785687c
·
verified ·
1 Parent(s): 120a2b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -42,6 +42,17 @@ class BasicAgent:
42
 
43
  def __init__(self):
44
  print("SimpleCodeAgent initialized.")
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  if SMOLAGENTS_AVAILABLE:
47
  try:
@@ -49,7 +60,8 @@ class BasicAgent:
49
  self.model = TransformersModel(
50
  model_id="google/gemma-3-4b-it",
51
  torch_dtype=torch.float16,
52
- device_map="auto"
 
53
  )
54
 
55
  # Create CodeAgent with DuckDuckGoSearchTool (core Unit 2 concept)
 
42
 
43
  def __init__(self):
44
  print("SimpleCodeAgent initialized.")
45
+
46
+ # Check GPU availability
47
+ print(f"🔍 GPU Check:")
48
+ print(f" - CUDA available: {torch.cuda.is_available()}")
49
+ if torch.cuda.is_available():
50
+ print(f" - CUDA device count: {torch.cuda.device_count()}")
51
+ print(f" - Current device: {torch.cuda.current_device()}")
52
+ print(f" - Device name: {torch.cuda.get_device_name()}")
53
+ print(f" - Device memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.1f} GB")
54
+ else:
55
+ print(" - No CUDA devices found -- must research this more !!")
56
 
57
  if SMOLAGENTS_AVAILABLE:
58
  try:
 
60
  self.model = TransformersModel(
61
  model_id="google/gemma-3-4b-it",
62
  torch_dtype=torch.float16,
63
+ device_map="auto",
64
+ trust_remote_code=True,
65
  )
66
 
67
  # Create CodeAgent with DuckDuckGoSearchTool (core Unit 2 concept)