orrinin commited on
Commit
f2a743d
·
verified ·
1 Parent(s): a35f7f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -8,7 +8,6 @@ from gradio import utils
8
  MODEL_NAME = "QWEN"
9
  client_chat = os.environ.get("CHAT_URL")
10
  client_vl = os.environ.get("VL_URL")
11
- ABS_URL = "https:///orrinin-hcare.hf.space/file="
12
  def read(filename):
13
  with open(filename) as f:
14
  data = f.read()
@@ -52,13 +51,13 @@ def process_text(text_input, unit):
52
  api_name="/model_chat"
53
  )
54
  time.sleep(10)
55
- response = job.result()
56
  print(response)
57
  return response[1][0][0]
58
 
59
  def process_image(image_input, unit):
60
  if image_input is not None:
61
- image = ABS_URL + image_input
62
  print(image_input,image)
63
  #with open(image_input, "rb") as f:
64
  # base64_image = base64.b64encode(f.read()).decode("utf-8")
 
8
  MODEL_NAME = "QWEN"
9
  client_chat = os.environ.get("CHAT_URL")
10
  client_vl = os.environ.get("VL_URL")
 
11
  def read(filename):
12
  with open(filename) as f:
13
  data = f.read()
 
51
  api_name="/model_chat"
52
  )
53
  time.sleep(10)
54
+ response = job.result(timeout=30)
55
  print(response)
56
  return response[1][0][0]
57
 
58
  def process_image(image_input, unit):
59
  if image_input is not None:
60
+ image = file(image_input)
61
  print(image_input,image)
62
  #with open(image_input, "rb") as f:
63
  # base64_image = base64.b64encode(f.read()).decode("utf-8")