Spaces:
Runtime error
Runtime error
| # BELOW 2 ROWS NOT CORRECTLY WORKING !!!!! | |
| # import gradio as gr | |
| # gr.load("models/Efficient-Large-Model/VILA1.5-3b").launch() | |
| import gradio as gr | |
| from transformers import AutoModel, AutoProcessor | |
| # Load model and processor | |
| model = AutoModel.from_pretrained("Efficient-Large-Model/VILA1.5-3b") | |
| processor = AutoProcessor.from_pretrained("Efficient-Large-Model/VILA1.5-3b") | |
| # Define function for model inference | |
| def predict(input_text): | |
| # Process and perform inference on input_text | |
| # Note: Adapt this based on your model’s expected inputs/outputs | |
| inputs = processor(text=input_text, return_tensors="pt") | |
| outputs = model(**inputs) | |
| return outputs.logits # or other processing based on model outputs | |
| # Launch Gradio interface | |
| gr.Interface( | |
| fn=predict, | |
| inputs="text", | |
| outputs="text" | |
| ).launch() | |