Spaces:
Sleeping
Sleeping
Nhughes09 commited on
Commit Β·
2d04aa7
1
Parent(s): 386658a
Fix: Switch from gated Llama 3.2 to ungated TinyLlama-1.1B-Chat
Browse files
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
|
| 499 |
try:
|
| 500 |
from transformers import pipeline
|
| 501 |
logger.info(" β
Transformers library imported")
|
| 502 |
|
| 503 |
self.local_ai = pipeline(
|
| 504 |
"text-generation",
|
| 505 |
-
model="
|
| 506 |
device="cpu",
|
| 507 |
torch_dtype="auto"
|
| 508 |
)
|
| 509 |
-
logger.info(" β
|
| 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
|
| 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...")
|