5m4ck3r commited on
Commit
edfcb6a
·
verified ·
1 Parent(s): f3d653b

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -9,6 +9,10 @@ def get_answer(image: str, question: str):
9
  spid = os.getenv('SPID')
10
  hug = hugging(spid)
11
  filelink = hug.upload(filename)
 
 
 
 
12
  data = [
13
  {
14
  "meta": {
@@ -17,7 +21,7 @@ def get_answer(image: str, question: str):
17
  "mime_type": "image/jpeg",
18
  "orig_name": filename,
19
  "path": filelink.split("=", 1)[1],
20
- "size": os.path.getsize(filename),
21
  "url": filelink
22
  },
23
  question,
 
9
  spid = os.getenv('SPID')
10
  hug = hugging(spid)
11
  filelink = hug.upload(filename)
12
+ file = request.files['file']
13
+ file.seek(0, 2)
14
+ file_size = file.tell()
15
+ file.seek(0)
16
  data = [
17
  {
18
  "meta": {
 
21
  "mime_type": "image/jpeg",
22
  "orig_name": filename,
23
  "path": filelink.split("=", 1)[1],
24
+ "size": file_size,
25
  "url": filelink
26
  },
27
  question,