seawolf2357 commited on
Commit
a403b1d
ยท
verified ยท
1 Parent(s): 04b5cc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -38,7 +38,6 @@ def generate_contents(user_content, brand_name, aspect_ratio='landscape'):
38
  "backgroundMusicKeywords": "happy, lofi, beats"
39
  }
40
 
41
-
42
  headers = set_header()
43
  response = requests.request("POST", url, json=payload, headers=headers).json()
44
 
@@ -65,9 +64,12 @@ def generate_status(content_id):
65
  else:
66
  break
67
  return 'FAILED'
 
68
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ํ•จ์ˆ˜
69
  def gradio_generate_contents(user_content, brand_name, aspect_ratio):
70
- return generate_contents(user_content, brand_name, aspect_ratio)
 
 
71
 
72
  def gradio_generate_status(content_id):
73
  download_url = generate_status(content_id)
@@ -80,11 +82,6 @@ def gradio_generate_status(content_id):
80
  return html_link + '<br>' + html_video, markdown_text
81
  else:
82
  return "์ปจํ…์ธ  ์ƒ์„ฑ ์‹คํŒจ ๋˜๋Š” ID๊ฐ€ ์ž˜๋ชป๋˜์—ˆ์Šต๋‹ˆ๋‹ค.", markdown_text
83
-
84
- def gradio_generate_contents(user_content, brand_name, aspect_ratio):
85
- content_id = generate_contents(user_content, brand_name, aspect_ratio)
86
- markdown_text = "๋น„๋””์˜ค ์Šคํฌ๋ฆฝํŠธ ์ž๋™ ์ƒ์„ฑ ํด๋ฆญ: [์—ฌ๊ธฐ๋ฅผ ํด๋ฆญํ•˜์„ธ์š”](https://seawolf2357-hyejascript.hf.space)"
87
- return content_id, markdown_text
88
 
89
  iface_create = gr.Interface(
90
  fn=gradio_generate_contents,
@@ -111,8 +108,6 @@ iface_create = gr.Interface(
111
  ]
112
  )
113
 
114
-
115
- # ์ƒํƒœ ํ™•์ธ ๋ฐ ๋น„๋””์˜ค ๋‹ค์šด๋กœ๋“œ ์ธํ„ฐํŽ˜์ด์Šค
116
  iface_status = gr.Interface(
117
  fn=gradio_generate_status,
118
  inputs=gr.Textbox(label="์ปจํ…์ธ  ID"),
@@ -122,6 +117,5 @@ iface_status = gr.Interface(
122
  ]
123
  )
124
 
125
- # ๋‘ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํƒญ์œผ๋กœ ๊ตฌ์„ฑ
126
  iface_combined = gr.TabbedInterface([iface_create, iface_status], ["์ปจํ…์ธ  ์ƒ์„ฑ", "์ƒํƒœ ํ™•์ธ ๋ฐ ๋‹ค์šด๋กœ๋“œ"])
127
  iface_combined.launch(auth=("arxivgpt", "Arxiv1234!@"))
 
38
  "backgroundMusicKeywords": "happy, lofi, beats"
39
  }
40
 
 
41
  headers = set_header()
42
  response = requests.request("POST", url, json=payload, headers=headers).json()
43
 
 
64
  else:
65
  break
66
  return 'FAILED'
67
+
68
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ํ•จ์ˆ˜
69
  def gradio_generate_contents(user_content, brand_name, aspect_ratio):
70
+ content_id = generate_contents(user_content, brand_name, aspect_ratio)
71
+ markdown_text = "๋น„๋””์˜ค ์Šคํฌ๋ฆฝํŠธ ์ž๋™ ์ƒ์„ฑ ํด๋ฆญ: [์—ฌ๊ธฐ๋ฅผ ํด๋ฆญํ•˜์„ธ์š”](https://seawolf2357-hyejascript.hf.space)"
72
+ return content_id, markdown_text
73
 
74
  def gradio_generate_status(content_id):
75
  download_url = generate_status(content_id)
 
82
  return html_link + '<br>' + html_video, markdown_text
83
  else:
84
  return "์ปจํ…์ธ  ์ƒ์„ฑ ์‹คํŒจ ๋˜๋Š” ID๊ฐ€ ์ž˜๋ชป๋˜์—ˆ์Šต๋‹ˆ๋‹ค.", markdown_text
 
 
 
 
 
85
 
86
  iface_create = gr.Interface(
87
  fn=gradio_generate_contents,
 
108
  ]
109
  )
110
 
 
 
111
  iface_status = gr.Interface(
112
  fn=gradio_generate_status,
113
  inputs=gr.Textbox(label="์ปจํ…์ธ  ID"),
 
117
  ]
118
  )
119
 
 
120
  iface_combined = gr.TabbedInterface([iface_create, iface_status], ["์ปจํ…์ธ  ์ƒ์„ฑ", "์ƒํƒœ ํ™•์ธ ๋ฐ ๋‹ค์šด๋กœ๋“œ"])
121
  iface_combined.launch(auth=("arxivgpt", "Arxiv1234!@"))