yuntian-deng commited on
Commit
4b0034d
1 Parent(s): 6bcf12d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -4,6 +4,10 @@ import numpy as np
4
  import requests
5
  import base64
6
  import os
 
 
 
 
7
 
8
  API_ENDPOINT = os.getenv('API_ENDPOINT')
9
  API_KEY = os.getenv('API_KEY')
@@ -27,6 +31,8 @@ with gr.Blocks() as demo:
27
  inputs = [textbox]
28
  outputs = [slider, image, submit_btn]
29
  def infer(formula):
 
 
30
  data = {'formula': formula, 'api_key': API_KEY}
31
  try:
32
  with requests.post(url=API_ENDPOINT, data=data, timeout=600, stream=True) as r:
 
4
  import requests
5
  import base64
6
  import os
7
+ from datetime import datetime
8
+ from pytz import timezone
9
+
10
+ tz = timezone('EST')
11
 
12
  API_ENDPOINT = os.getenv('API_ENDPOINT')
13
  API_KEY = os.getenv('API_KEY')
 
31
  inputs = [textbox]
32
  outputs = [slider, image, submit_btn]
33
  def infer(formula):
34
+ current_time = datetime.now(tz)
35
+ print (current_time, formula)
36
  data = {'formula': formula, 'api_key': API_KEY}
37
  try:
38
  with requests.post(url=API_ENDPOINT, data=data, timeout=600, stream=True) as r: