Spaces:
Running
on
Zero
Running
on
Zero
gokaygokay
commited on
Commit
•
ac73954
1
Parent(s):
78e7db6
Update app.py
Browse files
app.py
CHANGED
@@ -116,13 +116,10 @@ DEFAULT_NEGATIVE_SUFFIX = "Nsfw oversaturated crappy_art low_quality blurry bad_
|
|
116 |
|
117 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
118 |
|
119 |
-
def load_models():
|
120 |
-
with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports):
|
121 |
-
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True).to(device).eval()
|
122 |
-
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True)
|
123 |
-
return florence_model, florence_processor
|
124 |
|
125 |
-
florence_model
|
|
|
|
|
126 |
|
127 |
# Prompt Enhancer
|
128 |
enhancer_medium = pipeline("summarization", model="gokaygokay/Lamini-Prompt-Enchance", device=device)
|
|
|
116 |
|
117 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
118 |
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
+
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True).to(device).eval()
|
121 |
+
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True)
|
122 |
+
|
123 |
|
124 |
# Prompt Enhancer
|
125 |
enhancer_medium = pipeline("summarization", model="gokaygokay/Lamini-Prompt-Enchance", device=device)
|