Update app.py
Browse files
app.py
CHANGED
|
@@ -180,7 +180,7 @@ def handle_file(file, prompt, extra_prompt, max_new_tokens, progress=gr.Progress
|
|
| 180 |
# --- 3. Inference Function ---
|
| 181 |
@spaces.GPU
|
| 182 |
def run_inference(img: Image.Image, prompt: str = "", max_new_tokens: int = 512) -> str:
|
| 183 |
-
|
| 184 |
if img.mode != "RGB":
|
| 185 |
img = img.convert("RGB")
|
| 186 |
prompt_text = prompt.strip()
|
|
|
|
| 180 |
# --- 3. Inference Function ---
|
| 181 |
@spaces.GPU
|
| 182 |
def run_inference(img: Image.Image, prompt: str = "", max_new_tokens: int = 512) -> str:
|
| 183 |
+
model.to("cuda")
|
| 184 |
if img.mode != "RGB":
|
| 185 |
img = img.convert("RGB")
|
| 186 |
prompt_text = prompt.strip()
|