ekta / app.py
umeshhh's picture
Update app.py
0899c0c verified
raw
history blame
811 Bytes
import gradio as gr
from transformers import AutoProcessor, AutoModel
# Model name
model_name = "facebook/VFusion3D"
# Load processor and model with trusted code
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
# Define prediction function
def predict(input_text):
# Convert input into a format the model understands
inputs = processor(inputs=input_text, return_tensors="pt")
outputs = model(**inputs)
return outputs.logits.tolist()
# Gradio interface
interface = gr.Interface(
fn=predict,
inputs="text",
outputs="text",
title="VFusion3D Deployment",
description="A demo for facebook/VFusion3D model."
)
# Launch the app
if __name__ == "__main__":
interface.launch()