Nhughes09 commited on
Commit
2d04aa7
Β·
1 Parent(s): 386658a

Fix: Switch from gated Llama 3.2 to ungated TinyLlama-1.1B-Chat

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -495,23 +495,23 @@ class ExponentialLearner:
495
  try:
496
  # Step 1: Initialize model (cached after first load)
497
  if not hasattr(self, 'local_ai'):
498
- logger.info("πŸ”„ Step 1/5: Loading Llama 3.2-1B-Instruct model...")
499
  try:
500
  from transformers import pipeline
501
  logger.info(" βœ… Transformers library imported")
502
 
503
  self.local_ai = pipeline(
504
  "text-generation",
505
- model="meta-llama/Llama-3.2-1B-Instruct",
506
  device="cpu",
507
  torch_dtype="auto"
508
  )
509
- logger.info(" βœ… Llama 3.2 model loaded successfully!")
510
  except Exception as model_error:
511
  logger.error(f" ❌ Model loading FAILED: {model_error}", exc_info=True)
512
  raise Exception(f"AI Model Loading Failed: {model_error}")
513
  else:
514
- logger.info("βœ… Step 1/5: Using cached Llama 3.2 model")
515
 
516
  # Step 2: Construct structured AI prompt with clear output format
517
  logger.info("πŸ“ Step 2/5: Constructing trading prompt...")
 
495
  try:
496
  # Step 1: Initialize model (cached after first load)
497
  if not hasattr(self, 'local_ai'):
498
+ logger.info("πŸ”„ Step 1/5: Loading TinyLlama-1.1B-Chat model...")
499
  try:
500
  from transformers import pipeline
501
  logger.info(" βœ… Transformers library imported")
502
 
503
  self.local_ai = pipeline(
504
  "text-generation",
505
+ model="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
506
  device="cpu",
507
  torch_dtype="auto"
508
  )
509
+ logger.info(" βœ… TinyLlama model loaded successfully!")
510
  except Exception as model_error:
511
  logger.error(f" ❌ Model loading FAILED: {model_error}", exc_info=True)
512
  raise Exception(f"AI Model Loading Failed: {model_error}")
513
  else:
514
+ logger.info("βœ… Step 1/5: Using cached TinyLlama model")
515
 
516
  # Step 2: Construct structured AI prompt with clear output format
517
  logger.info("πŸ“ Step 2/5: Constructing trading prompt...")