Spaces:
Sleeping
Sleeping
fix indent create_llm_pipeline
Browse files
app.py
CHANGED
|
@@ -229,8 +229,8 @@ def get_fallback_model(current_model):
|
|
| 229 |
# Optimized pipeline for models
|
| 230 |
def create_optimized_pipeline(model, tokenizer, model_key):
|
| 231 |
"""Optimized pipeline for models"""
|
| 232 |
-
|
| 233 |
-
|
| 234 |
"text-generation",
|
| 235 |
model=model,
|
| 236 |
tokenizer=tokenizer,
|
|
@@ -240,8 +240,8 @@ def create_optimized_pipeline(model, tokenizer, model_key):
|
|
| 240 |
top_k=30,
|
| 241 |
repetition_penalty=1.2,
|
| 242 |
return_full_text=False,
|
| 243 |
-
|
| 244 |
-
|
| 245 |
|
| 246 |
def create_llm_pipeline(model_key):
|
| 247 |
"""Create a new pipeline using the specified model with better error handling"""
|
|
|
|
| 229 |
# Optimized pipeline for models
|
| 230 |
def create_optimized_pipeline(model, tokenizer, model_key):
|
| 231 |
"""Optimized pipeline for models"""
|
| 232 |
+
# Default pipeline for other models
|
| 233 |
+
pipe = pipeline(
|
| 234 |
"text-generation",
|
| 235 |
model=model,
|
| 236 |
tokenizer=tokenizer,
|
|
|
|
| 240 |
top_k=30,
|
| 241 |
repetition_penalty=1.2,
|
| 242 |
return_full_text=False,
|
| 243 |
+
)
|
| 244 |
+
return HuggingFacePipeline(pipeline=pipe)
|
| 245 |
|
| 246 |
def create_llm_pipeline(model_key):
|
| 247 |
"""Create a new pipeline using the specified model with better error handling"""
|