Renecto commited on
Commit
1cc4be1
·
verified ·
1 Parent(s): 9316cdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -6,7 +6,7 @@ import concurrent
6
  client = Client("abidlabs/en2fr")
7
  inputs = ["Hello", "Bonjour", "Hola", "Guten Tag", "Ciao"]
8
 
9
- start_total = time.time()
10
  def fetch_result(i):
11
  start = time.time()
12
  job = client.submit(i, api_name="/predict")
@@ -16,6 +16,7 @@ def fetch_result(i):
16
  return result, duration
17
 
18
  def ens2frs(ens):
 
19
  en = ens.split("\n")
20
  with concurrent.futures.ThreadPoolExecutor() as executor:
21
  results = list(executor.map(fetch_result, en))
 
6
  client = Client("abidlabs/en2fr")
7
  inputs = ["Hello", "Bonjour", "Hola", "Guten Tag", "Ciao"]
8
 
9
+
10
  def fetch_result(i):
11
  start = time.time()
12
  job = client.submit(i, api_name="/predict")
 
16
  return result, duration
17
 
18
  def ens2frs(ens):
19
+ start_total = time.time()
20
  en = ens.split("\n")
21
  with concurrent.futures.ThreadPoolExecutor() as executor:
22
  results = list(executor.map(fetch_result, en))