OpceanAI commited on
Commit
ce4d4cb
·
verified ·
1 Parent(s): 2c8eca8

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. pasita.py +1 -1
app.py CHANGED
@@ -45,7 +45,7 @@ def _counter(text: str) -> str:
45
  def _estimate_duration(text, num_candidates=3, structured_fallback=True, *args, **kwargs):
46
  if structured_fallback and infer_kind((text or "").strip()) in ("html", "data"):
47
  return 10
48
- return min(60, max(20, 14 + len(text or "") // 40 + 6 * (int(num_candidates) - 1)))
49
 
50
 
51
  @spaces.GPU(duration=_estimate_duration)
 
45
  def _estimate_duration(text, num_candidates=3, structured_fallback=True, *args, **kwargs):
46
  if structured_fallback and infer_kind((text or "").strip()) in ("html", "data"):
47
  return 10
48
+ return min(30, max(12, 8 + len(text or "") // 200 + 4 * (int(num_candidates) - 1)))
49
 
50
 
51
  @spaces.GPU(duration=_estimate_duration)
pasita.py CHANGED
@@ -526,7 +526,7 @@ def postprocess(raw: str, input_text: str | None = None) -> str:
526
  return text if text else original
527
 
528
 
529
- NUM_RE = re.compile(r"\d[\d.,]*%?")
530
  WORD_RE = re.compile(r"[a-zA-ZáéíóúüñçÁÉÍÓÚÜÑÇ]{3,}")
531
  LIST_RE = re.compile(r"^\s*(?:[-*•]|\d+[.)])\s+\S", re.M)
532
  TABLE_ROW_RE = re.compile(r"^\s*\|.*\|\s*$", re.M)
 
526
  return text if text else original
527
 
528
 
529
+ NUM_RE = re.compile(r"\d+(?:[.,]\d+)?%?")
530
  WORD_RE = re.compile(r"[a-zA-ZáéíóúüñçÁÉÍÓÚÜÑÇ]{3,}")
531
  LIST_RE = re.compile(r"^\s*(?:[-*•]|\d+[.)])\s+\S", re.M)
532
  TABLE_ROW_RE = re.compile(r"^\s*\|.*\|\s*$", re.M)