next-playground commited on
Commit
c565b19
1 Parent(s): a909e07

Update flask_api_full_song.py

Browse files
Files changed (1) hide show
  1. flask_api_full_song.py +5 -0
flask_api_full_song.py CHANGED
@@ -17,6 +17,9 @@ secret_key = os.getenv('SECRET_KEY')
17
  region = 'na-siliconvalley'
18
  bucket_name = 'xiaohei-cat-ai-1304646510'
19
 
 
 
 
20
  config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
21
  client = CosS3Client(config)
22
 
@@ -32,6 +35,8 @@ response2 = client.download_file(
32
  DestFilePath="/tmp/config.json"
33
  )
34
 
 
 
35
  model_name = "/tmp/G_full.pth" # 模型地址
36
  config_name = "/tmp/config.json" # config地址
37
  svc_model = infer_tool.Svc(model_name, config_name)
 
17
  region = 'na-siliconvalley'
18
  bucket_name = 'xiaohei-cat-ai-1304646510'
19
 
20
+ workdir = os.getcwd()
21
+ os.chdir("/tmp")
22
+
23
  config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
24
  client = CosS3Client(config)
25
 
 
35
  DestFilePath="/tmp/config.json"
36
  )
37
 
38
+ os.chdir(workdir)
39
+
40
  model_name = "/tmp/G_full.pth" # 模型地址
41
  config_name = "/tmp/config.json" # config地址
42
  svc_model = infer_tool.Svc(model_name, config_name)