fix the @spaces.GPU
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ def describe_image(image, user_question="Describe this image in great detail."):
|
|
46 |
).to('cpu')
|
47 |
|
48 |
# Load and prepare the model
|
49 |
-
vl_gpt = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True).to(torch.bfloat16).
|
50 |
|
51 |
# Generate embeddings from the image input
|
52 |
inputs_embeds = vl_gpt.prepare_inputs_embeds(**prepare_inputs)
|
|
|
46 |
).to('cpu')
|
47 |
|
48 |
# Load and prepare the model
|
49 |
+
vl_gpt = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True).to(torch.bfloat16).cpu().eval()
|
50 |
|
51 |
# Generate embeddings from the image input
|
52 |
inputs_embeds = vl_gpt.prepare_inputs_embeds(**prepare_inputs)
|