Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1167,11 +1167,12 @@ def display_historical_data(storage_location: str, url: str):
|
|
1167 |
# Function to load the "google/flan-t5-xl" model
|
1168 |
def load_model():
|
1169 |
"""
|
1170 |
-
Loads the
|
1171 |
"""
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
|
|
1175 |
|
1176 |
# Determine the maximum supported length for the model
|
1177 |
max_supported_length = 2048 # You might need to adjust this
|
|
|
1167 |
# Function to load the "google/flan-t5-xl" model
|
1168 |
def load_model():
|
1169 |
"""
|
1170 |
+
Loads the openLlama model and tokenizer once and returns the pipeline.
|
1171 |
"""
|
1172 |
+
try:
|
1173 |
+
model_name = "openlm-research/open_llama_3b_v2" # Correct indentation here
|
1174 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False, legacy=False)
|
1175 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
1176 |
|
1177 |
# Determine the maximum supported length for the model
|
1178 |
max_supported_length = 2048 # You might need to adjust this
|