Spaces:
Sleeping
Sleeping
update app
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import yfinance as yf
|
|
| 3 |
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
| 6 |
-
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
| 7 |
from datetime import datetime, timedelta
|
| 8 |
import plotly.graph_objects as go
|
| 9 |
import plotly.express as px
|
|
@@ -37,12 +37,11 @@ def load_model():
|
|
| 37 |
device_map="auto",
|
| 38 |
trust_remote_code=True
|
| 39 |
)
|
| 40 |
-
# FIX 2:
|
| 41 |
-
#
|
| 42 |
-
tokenizer =
|
| 43 |
"amazon/chronos-bolt-base",
|
| 44 |
-
trust_remote_code=True
|
| 45 |
-
use_fast=False
|
| 46 |
)
|
| 47 |
return model, tokenizer
|
| 48 |
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
| 6 |
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
| 7 |
from datetime import datetime, timedelta
|
| 8 |
import plotly.graph_objects as go
|
| 9 |
import plotly.express as px
|
|
|
|
| 37 |
device_map="auto",
|
| 38 |
trust_remote_code=True
|
| 39 |
)
|
| 40 |
+
# FIX 2: Use AutoTokenizer and rely SOLELY on trust_remote_code=True
|
| 41 |
+
# This forces the loading of the custom ChronosTokenizer class, bypassing the conflicting T5 conversion logic.
|
| 42 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 43 |
"amazon/chronos-bolt-base",
|
| 44 |
+
trust_remote_code=True
|
|
|
|
| 45 |
)
|
| 46 |
return model, tokenizer
|
| 47 |
|