Spaces:
Running
Running
Enhance app.py with improved user interface and instructions, update model ID in llm.py, and add image classification capabilities across various components. Introduce segment anything functionality and refine README for clarity on model capabilities.
518d841
import modal | |
from smolagents import Tool | |
from transformers import pipeline | |
from .app import app | |
from .image import image | |
class InferencePipelineModalApp: | |
def forward(self, task: str, model_name: str, image, **kwargs): | |
try: | |
pipe = pipeline(task=task, model=model_name, device="cuda") | |
result = pipe(image, **kwargs) | |
return result | |
except Exception as e: | |
raise Exception(f"Error in inference pipeline: {e}. Please try again with a different model.") | |