Kaixuanliu commited on
Commit
4da242e
1 Parent(s): aacdbea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -8,7 +8,7 @@ from huggingface_hub import login
8
 
9
  # myip = os.environ["0.0.0.0"]
10
  # myport = os.environ["80"]
11
- myip = "34.221.7.12"
12
  myport=8000
13
 
14
  is_spaces = True if "SPACE_ID" in os.environ else False
@@ -33,17 +33,17 @@ def excute_udiff(diffusion_model_id, concept, steps):
33
  response = requests.post('http://{}:{}/udiff'.format(myip, myport), json={"diffusion_model_id": diffusion_model_id, "concept": concept, "steps": steps})
34
  print(f"result: {response}")
35
  # result = result.text[1:-1]
36
- res1 = ""
37
- res2 = ""
38
  if response.status_code == 200:
39
  response_json = response.json()
40
  print(response_json)
41
- res1 = response_json['input_prompt']
42
- res2 = response_json['output_prompt']
43
  else:
44
  print(f"Request failed with status code {response.status_code}")
45
 
46
- return res1, res2
47
 
48
 
49
  css = '''
 
8
 
9
  # myip = os.environ["0.0.0.0"]
10
  # myport = os.environ["80"]
11
+ myip = "52.34.14.64"
12
  myport=8000
13
 
14
  is_spaces = True if "SPACE_ID" in os.environ else False
 
33
  response = requests.post('http://{}:{}/udiff'.format(myip, myport), json={"diffusion_model_id": diffusion_model_id, "concept": concept, "steps": steps})
34
  print(f"result: {response}")
35
  # result = result.text[1:-1]
36
+ prompt1 = ""
37
+ prompt2 = ""
38
  if response.status_code == 200:
39
  response_json = response.json()
40
  print(response_json)
41
+ prompt1 = response_json['input_prompt']
42
+ prompt2 = response_json['output_prompt']
43
  else:
44
  print(f"Request failed with status code {response.status_code}")
45
 
46
+ return prompt1, prompt2
47
 
48
 
49
  css = '''