fantaxy commited on
Commit
3110d10
โ€ข
1 Parent(s): a98610e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -14,13 +14,13 @@ api_client = Client("http://211.233.58.202:7960/")
14
 
15
  # Notion API ์„ค์ •
16
  NOTION_API_KEY = "secret_MpVfJphbfo4599fdczYfMYKNOpyzCcvkhhzk3lgTfVk"
17
- NOTION_DATABASE_ID = "88c9bdadcb2044129af77d5932e1a82a"
18
  NOTION_API_URL = "https://api.notion.com/v1"
19
 
20
  headers = {
21
  "Authorization": f"Bearer {NOTION_API_KEY}",
22
  "Content-Type": "application/json",
23
- "Notion-Version": "2022-06-28"
24
  }
25
 
26
  def upload_to_notion(prompt, image_url):
@@ -71,8 +71,10 @@ def upload_to_notion(prompt, image_url):
71
  logging.error(f"Failed to add to Notion: {e}")
72
  logging.error(f"Response content: {response.text}")
73
  logging.error(f"Request payload: {json.dumps(data, indent=2)}")
 
74
  raise Exception(f"Failed to add to Notion: {e}")
75
 
 
76
  def respond(message, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
77
  logging.info(f"Received message: {message}, seed: {seed}, randomize_seed: {randomize_seed}, "
78
  f"width: {width}, height: {height}, guidance_scale: {guidance_scale}, "
 
14
 
15
  # Notion API ์„ค์ •
16
  NOTION_API_KEY = "secret_MpVfJphbfo4599fdczYfMYKNOpyzCcvkhhzk3lgTfVk"
17
+ NOTION_DATABASE_ID = "88c9bdad-cb20-4412-9af7-7d5932e1a82a"
18
  NOTION_API_URL = "https://api.notion.com/v1"
19
 
20
  headers = {
21
  "Authorization": f"Bearer {NOTION_API_KEY}",
22
  "Content-Type": "application/json",
23
+ "Notion-Version": "2022-06-28" # ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๋ฐ์ดํŠธ
24
  }
25
 
26
  def upload_to_notion(prompt, image_url):
 
71
  logging.error(f"Failed to add to Notion: {e}")
72
  logging.error(f"Response content: {response.text}")
73
  logging.error(f"Request payload: {json.dumps(data, indent=2)}")
74
+ logging.error(f"Headers: {headers}") # API ํ‚ค๋Š” ๋กœ๊ทธ์— ๋‚จ๊ธฐ์ง€ ์•Š๋„๋ก ์ฃผ์˜ํ•˜์„ธ์š”
75
  raise Exception(f"Failed to add to Notion: {e}")
76
 
77
+
78
  def respond(message, seed, randomize_seed, width, height, guidance_scale, num_inference_steps):
79
  logging.info(f"Received message: {message}, seed: {seed}, randomize_seed: {randomize_seed}, "
80
  f"width: {width}, height: {height}, guidance_scale: {guidance_scale}, "