qingxu98 commited on
Commit
19aa87f
1 Parent(s): e788445
docker_as_a_service/docker_as_a_service.py CHANGED
@@ -116,6 +116,7 @@ async def stream_generator(request_obj):
116
  # read file
117
  server_file_attach = {}
118
  for fp, fn in zip(downloaded_files_path, downloaded_files):
 
119
  with open(fp, "rb") as f:
120
  file_bytes = f.read()
121
  server_file_attach[fn] = file_bytes
@@ -179,7 +180,9 @@ async def stream_response(file: UploadFile = File(...)):
179
 
180
  @app.get("/")
181
  async def hi():
182
- return "Hello, this is Docker as a Service (DaaS)!"
 
 
183
 
184
  if __name__ == "__main__":
185
  import uvicorn
 
116
  # read file
117
  server_file_attach = {}
118
  for fp, fn in zip(downloaded_files_path, downloaded_files):
119
+ if os.path.isdir(fp): continue
120
  with open(fp, "rb") as f:
121
  file_bytes = f.read()
122
  server_file_attach[fn] = file_bytes
 
180
 
181
  @app.get("/")
182
  async def hi():
183
+ return "Hello, this is Docker as a Service (DaaS)! If you want to use this service, you must duplicate this space. " \
184
+ "您好,这里是Docker作为服务(DaaS)!如果您想使用此服务,您必须复制此空间。复制方法:点击https://huggingface.co/spaces/hamercity/bbdown页面右上角的三个点,然后选择“复制空间”。" \
185
+ "此外,在设置中,你还需要修改URL,例如:DAAS_SERVER_URL = \"https://你的用户名-你的空间名.hf.space/stream\""
186
 
187
  if __name__ == "__main__":
188
  import uvicorn