microbamboo commited on
Commit
7f9d403
·
1 Parent(s): ca1a144

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -11,7 +11,6 @@ def get_key_sha256(key):
11
  sha256.update(key.encode('utf-8'))
12
  return sha256.hexdigest()
13
 
14
- match_sha256 = 'ffa007286cff75ab9c14e42282edd8e7e28b467a6e1bcd3d9b90dc40d375cae3'
15
  match_sha256 = 'ffa007286cff75ab9c14e42282edd8e7e28b467a6e1bcd3d9b90dc40d375cae3'
16
  data_folder = 'jobs'
17
  stages = ['new', 'doing', 'done']
@@ -102,13 +101,13 @@ def get_folder_list(folder, full=False):
102
  d = {}
103
  for machine_type in machine_types:
104
  fs = os.listdir(os.path.join(folder, machine_type))
105
- if full:
106
- dd = {}
107
- for f in fs:
108
  dd[f] = open(os.path.join(folder, machine_type, f)).read()
109
- d[machine_type] = dd
110
- else:
111
- d[machine_type] = fs
112
  return d
113
 
114
  @app.route("/stat", methods = ['GET'])
@@ -157,7 +156,5 @@ def clear():
157
  return 'ok'
158
 
159
 
160
-
161
-
162
  if __name__ == "__main__":
163
  app.run(host="0.0.0.0", port=7860, debug=True)
 
11
  sha256.update(key.encode('utf-8'))
12
  return sha256.hexdigest()
13
 
 
14
  match_sha256 = 'ffa007286cff75ab9c14e42282edd8e7e28b467a6e1bcd3d9b90dc40d375cae3'
15
  data_folder = 'jobs'
16
  stages = ['new', 'doing', 'done']
 
101
  d = {}
102
  for machine_type in machine_types:
103
  fs = os.listdir(os.path.join(folder, machine_type))
104
+ dd = {}
105
+ for f in fs:
106
+ if full:
107
  dd[f] = open(os.path.join(folder, machine_type, f)).read()
108
+ else:
109
+ dd[f] = open(os.path.join(folder, machine_type, f)).read(10)
110
+ d[machine_type] = dd
111
  return d
112
 
113
  @app.route("/stat", methods = ['GET'])
 
156
  return 'ok'
157
 
158
 
 
 
159
  if __name__ == "__main__":
160
  app.run(host="0.0.0.0", port=7860, debug=True)