Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,6 +24,7 @@ from slugify import slugify
|
|
| 24 |
if is_spaces:
|
| 25 |
from gradio_client import Client, handle_file
|
| 26 |
client = Client("multimodalart/Florence-2-l4")
|
|
|
|
| 27 |
|
| 28 |
if not is_spaces:
|
| 29 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
|
@@ -34,6 +35,11 @@ if not is_spaces:
|
|
| 34 |
|
| 35 |
MAX_IMAGES = 150
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
def load_captioning(uploaded_files, concept_sentence):
|
| 38 |
uploaded_images = [file for file in uploaded_files if not file.endswith('.txt')]
|
| 39 |
txt_files = [file for file in uploaded_files if file.endswith('.txt')]
|
|
|
|
| 24 |
if is_spaces:
|
| 25 |
from gradio_client import Client, handle_file
|
| 26 |
client = Client("multimodalart/Florence-2-l4")
|
| 27 |
+
import spaces
|
| 28 |
|
| 29 |
if not is_spaces:
|
| 30 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
|
|
|
| 35 |
|
| 36 |
MAX_IMAGES = 150
|
| 37 |
|
| 38 |
+
# In case someone marks their duplicate as Zero #
|
| 39 |
+
@spaces.GPU
|
| 40 |
+
def zero_placeholder():
|
| 41 |
+
pass
|
| 42 |
+
|
| 43 |
def load_captioning(uploaded_files, concept_sentence):
|
| 44 |
uploaded_images = [file for file in uploaded_files if not file.endswith('.txt')]
|
| 45 |
txt_files = [file for file in uploaded_files if file.endswith('.txt')]
|