formless 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of formless might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: formless
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Handwritten + image OCR.
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -49,7 +49,7 @@ IMAGE = GPU_IMAGE.pip_install( # add Python dependencies
49
49
  "vllm==0.6.2", "term-image==0.7.2"
50
50
  )
51
51
  API_TIMEOUT = 5 * MINUTES
52
- API_CONTAINER_IDLE_TIMEOUT = 20 * MINUTES # max
52
+ API_CONTAINER_IDLE_TIMEOUT = 1 * MINUTES # max
53
53
  API_ALLOW_CONCURRENT_INPUTS = 1000 # max
54
54
 
55
55
  GPU_TYPE = "H100"
@@ -135,6 +135,7 @@ class Model:
135
135
  generated_text = outputs[0].outputs[0].text.strip()
136
136
 
137
137
  # show the question, image, and response in the terminal for demonstration purposes
138
+ response = requests.get(image_url)
138
139
  image_filename = image_url.split("/")[-1]
139
140
  image_path = os.path.join(tempfile.gettempdir(), f"{uuid4()}-{image_filename}")
140
141
  with open(image_path, "wb") as file:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "formless"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "Handwritten + image OCR."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -3,8 +3,6 @@ import os
3
3
  import tempfile
4
4
  import time
5
5
  from uuid import uuid4
6
- from dotenv import load_dotenv
7
- from pathlib import Path
8
6
  from term_image.image import from_file
9
7
  import requests
10
8
  from rich import print
@@ -12,10 +10,9 @@ from rich.progress import Progress, SpinnerColumn, TextColumn
12
10
  import typer
13
11
  from typing_extensions import Annotated
14
12
 
15
- from utils import DEFAULT_IMG_URL
16
13
 
17
- parent_path = Path(__file__).parent.parent.parent
18
- load_dotenv(parent_path / ".env")
14
+ DEFAULT_IMG_URL = "https://modal-public-assets.s3.amazonaws.com/golden-gate-bridge.jpg"
15
+ API_URL = "https://andrewhinh--formless-api-model-infer.modal.run"
19
16
 
20
17
  # Typer CLI
21
18
  app = typer.Typer(
@@ -26,9 +23,8 @@ state = {"verbose": False}
26
23
 
27
24
  # Fns
28
25
  def run() -> None:
29
- api_url = os.getenv("API_URL")
30
26
  image_url = state["image_url"]
31
- response = requests.post(api_url, json={"image_url": image_url})
27
+ response = requests.post(API_URL, json={"image_url": image_url})
32
28
  assert response.ok, response.status_code
33
29
  return response.json()
34
30
 
@@ -200,7 +200,7 @@ wheels = [
200
200
 
201
201
  [[package]]
202
202
  name = "formless"
203
- version = "0.1.0"
203
+ version = "0.3.0"
204
204
  source = { editable = "." }
205
205
  dependencies = [
206
206
  { name = "modal" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes