Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,8 @@ def load_model():
|
|
28 |
model_id = "microsoft/Florence-2-large"
|
29 |
#processor loading
|
30 |
st.session_state.processor = AutoProcessor.from_pretrained(model_id, torch_dtype=torch.qint8, trust_remote_code=True)
|
31 |
-
|
|
|
32 |
# Load the model normally
|
33 |
with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports): # workaround for unnecessary flash_attn requirement
|
34 |
model = AutoModelForCausalLM.from_pretrained(model_id, attn_implementation="sdpa", trust_remote_code=True)
|
|
|
28 |
model_id = "microsoft/Florence-2-large"
|
29 |
#processor loading
|
30 |
st.session_state.processor = AutoProcessor.from_pretrained(model_id, torch_dtype=torch.qint8, trust_remote_code=True)
|
31 |
+
|
32 |
+
os.mkdir("temp", exist_ok=True)
|
33 |
# Load the model normally
|
34 |
with patch("transformers.dynamic_module_utils.get_imports", fixed_get_imports): # workaround for unnecessary flash_attn requirement
|
35 |
model = AutoModelForCausalLM.from_pretrained(model_id, attn_implementation="sdpa", trust_remote_code=True)
|