Rdurango92 commited on
Commit
9f6f81d
1 Parent(s): fa48856

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. requirements.txt +2 -3
app.py CHANGED
@@ -5,8 +5,11 @@
5
  import gradio as gr
6
  from PIL import Image
7
  from transformers import AutoProcessor, AutoModelForCausalLM
8
- import torch
9
  import numpy as np
 
 
 
 
10
 
11
  # Cargar modelo y procesador
12
  ocr_model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-large", trust_remote_code=True)
 
5
  import gradio as gr
6
  from PIL import Image
7
  from transformers import AutoProcessor, AutoModelForCausalLM
 
8
  import numpy as np
9
+ import spaces
10
+
11
+ import subprocess
12
+ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
13
 
14
  # Cargar modelo y procesador
15
  ocr_model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-large", trust_remote_code=True)
requirements.txt CHANGED
@@ -3,6 +3,5 @@ Pillow
3
  torch
4
  numpy
5
  transformers
6
- flash_attn
7
- einops
8
- timm
 
3
  torch
4
  numpy
5
  transformers
6
+ timm
7
+ spaces