Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def replace_single_quotes(text):
|
|
| 26 |
return replaced_text
|
| 27 |
|
| 28 |
class PromptEnhancerV2:
|
| 29 |
-
@
|
| 30 |
def __init__(self, models_root_path, device_map="auto", torch_dtype="bfloat16"):#auto
|
| 31 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
| 32 |
if not logging.getLogger(__name__).handlers:
|
|
@@ -49,8 +49,7 @@ class PromptEnhancerV2:
|
|
| 49 |
self.processor = AutoProcessor.from_pretrained(models_root_path)
|
| 50 |
|
| 51 |
# @torch.inference_mode()
|
| 52 |
-
|
| 53 |
-
@zero.gpu
|
| 54 |
def predict(
|
| 55 |
self,
|
| 56 |
prompt_cot,
|
|
|
|
| 26 |
return replaced_text
|
| 27 |
|
| 28 |
class PromptEnhancerV2:
|
| 29 |
+
@spaces.GPU
|
| 30 |
def __init__(self, models_root_path, device_map="auto", torch_dtype="bfloat16"):#auto
|
| 31 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
| 32 |
if not logging.getLogger(__name__).handlers:
|
|
|
|
| 49 |
self.processor = AutoProcessor.from_pretrained(models_root_path)
|
| 50 |
|
| 51 |
# @torch.inference_mode()
|
| 52 |
+
@spaces.GPU
|
|
|
|
| 53 |
def predict(
|
| 54 |
self,
|
| 55 |
prompt_cot,
|