Spaces:
Running on Zero
Running on Zero
Commit ·
5e541e3
1
Parent(s): ff05d0c
updated to open image
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
import spaces
|
| 4 |
import torch
|
|
|
|
|
|
|
| 5 |
|
| 6 |
from vlm_inference import (
|
| 7 |
load_vlm_model,
|
|
@@ -68,6 +70,10 @@ def chat_fn(
|
|
| 68 |
print("[DEBUG] moving model to GPU")
|
| 69 |
model_gpu = model.to(device)
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
print("[DEBUG] preprocessing image")
|
| 72 |
image_tensor = image_processor(
|
| 73 |
images=image.convert("RGB"),
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import spaces
|
| 4 |
import torch
|
| 5 |
+
from PIL import Image
|
| 6 |
+
|
| 7 |
|
| 8 |
from vlm_inference import (
|
| 9 |
load_vlm_model,
|
|
|
|
| 70 |
print("[DEBUG] moving model to GPU")
|
| 71 |
model_gpu = model.to(device)
|
| 72 |
|
| 73 |
+
# AFTER(ログ以外で唯一必要な修正)
|
| 74 |
+
if isinstance(image, str):
|
| 75 |
+
image = Image.open(image)
|
| 76 |
+
|
| 77 |
print("[DEBUG] preprocessing image")
|
| 78 |
image_tensor = image_processor(
|
| 79 |
images=image.convert("RGB"),
|