abhishekt commited on
Commit
0894461
·
1 Parent(s): f916941
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -20,20 +20,20 @@ def generate_article(topic):
20
  )
21
  article = response.choices[0].text
22
 
23
- # Clean up the article text
24
- article = re.sub('\n', ' ', article)
25
- article = re.sub('\s+', ' ', article)
26
-
27
- # Split the article into 5 sections
28
- section_length = len(article) // 5
29
- sections = [article[i:i+section_length] for i in range(0, len(article), section_length)]
30
-
31
- # Combine the sections into a formatted blog post
32
- blog_post = f"# {topic}\n\n"
33
- for i in range(5):
34
- blog_post += f"## Section {i+1}\n\n{sections[i]}\n\n"
35
 
36
- return blog_post
37
 
38
  # Set up the Gradio interface
39
  iface = gr.Interface(
 
20
  )
21
  article = response.choices[0].text
22
 
23
+ # # Clean up the article text
24
+ # article = re.sub('\n', ' ', article)
25
+ # article = re.sub('\s+', ' ', article)
26
+
27
+ # # Split the article into 5 sections
28
+ # section_length = len(article) // 5
29
+ # sections = [article[i:i+section_length] for i in range(0, len(article), section_length)]
30
+
31
+ # # Combine the sections into a formatted blog post
32
+ # blog_post = f"# {topic}\n\n"
33
+ # for i in range(5):
34
+ # blog_post += f"## Section {i+1}\n\n{sections[i]}\n\n"
35
 
36
+ return article
37
 
38
  # Set up the Gradio interface
39
  iface = gr.Interface(