Ngaima Sandiman
commited on
Commit
·
a897083
1
Parent(s):
586f617
Added zerogpu decoration.
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import os
|
3 |
|
4 |
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
|
@@ -12,6 +13,7 @@ from src.model.modules.imagecraft import ImageCraft
|
|
12 |
model = ImageCraft.from_pretrained("nsandiman/imagecraft-ft-co-224")
|
13 |
|
14 |
|
|
|
15 |
def imagecraft_interface(image_path):
|
16 |
"""Process image inputs and generate audio response."""
|
17 |
transcript, audio_buffer = model.generate(image_path, output_type="buffer")
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
import os
|
4 |
|
5 |
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
|
|
|
13 |
model = ImageCraft.from_pretrained("nsandiman/imagecraft-ft-co-224")
|
14 |
|
15 |
|
16 |
+
@spaces.GPU
|
17 |
def imagecraft_interface(image_path):
|
18 |
"""Process image inputs and generate audio response."""
|
19 |
transcript, audio_buffer = model.generate(image_path, output_type="buffer")
|