Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def clean_scrap(artikel,link, openai_key):
|
|
| 75 |
openai.api_key = openai_key
|
| 76 |
if len(artikel) > 1:
|
| 77 |
for art in artikel:
|
| 78 |
-
response = openai.
|
| 79 |
model="gpt-3.5-turbo",
|
| 80 |
messages=[
|
| 81 |
{"role": "system", "content": "You are a very professional article editor."},
|
|
@@ -89,7 +89,7 @@ def clean_scrap(artikel,link, openai_key):
|
|
| 89 |
new_artikel.append(result)
|
| 90 |
else:
|
| 91 |
for art in artikel:
|
| 92 |
-
response = openai.
|
| 93 |
model="gpt-3.5-turbo",
|
| 94 |
messages=[
|
| 95 |
{"role": "system", "content": "You are a very professional article editor."},
|
|
@@ -104,7 +104,7 @@ def clean_scrap(artikel,link, openai_key):
|
|
| 104 |
|
| 105 |
new_art = [' '.join(new_artikel)]
|
| 106 |
for art in new_art:
|
| 107 |
-
response = openai.
|
| 108 |
model="gpt-3.5-turbo",
|
| 109 |
messages=[
|
| 110 |
{"role": "system", "content": "You are a very professional article editor and capable of generating compelling and professional article titles."},
|
|
@@ -119,7 +119,7 @@ def clean_scrap(artikel,link, openai_key):
|
|
| 119 |
|
| 120 |
content = article[0].split("\n")
|
| 121 |
title = content[0].replace('title:', '').replace("Title:", '').strip()
|
| 122 |
-
response = openai.
|
| 123 |
model="gpt-3.5-turbo",
|
| 124 |
messages=[
|
| 125 |
{"role": "system", "content": "You are a professional translator and rewriter"},
|
|
@@ -186,7 +186,7 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
| 186 |
|
| 187 |
openai.api_key = openai_key
|
| 188 |
for i in artikel:
|
| 189 |
-
response = openai.
|
| 190 |
model="gpt-3.5-turbo",
|
| 191 |
messages=[
|
| 192 |
{"role": "system", "content": "You are a proficient English to Indonesian language translator machine. You are capable of translating professionally according to the rules of the Indonesian language"},
|
|
@@ -201,7 +201,7 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
| 201 |
time.sleep(2)
|
| 202 |
|
| 203 |
for i in translated:
|
| 204 |
-
response = openai.
|
| 205 |
model="gpt-3.5-turbo",
|
| 206 |
messages=[
|
| 207 |
{"role": "system", "content": f"""You are a very professional article editor and perform SEO optimization on an article with utmost professionalism. berikut adalah SOP SEO yang harus kamu terapkan
|
|
@@ -223,7 +223,7 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
| 223 |
time.sleep(2)
|
| 224 |
|
| 225 |
for i in optimized:
|
| 226 |
-
response = openai.
|
| 227 |
model="gpt-3.5-turbo",
|
| 228 |
messages=[
|
| 229 |
{"role": "system", "content": f"""
|
|
@@ -259,7 +259,7 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
| 259 |
time.sleep(2)
|
| 260 |
|
| 261 |
for i in article:
|
| 262 |
-
response = openai.
|
| 263 |
model="gpt-3.5-turbo",
|
| 264 |
messages=[
|
| 265 |
{"role": "system", "content": "You are a professional article editor machine."},
|
|
@@ -272,7 +272,7 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
| 272 |
time.sleep(2)
|
| 273 |
|
| 274 |
for i in edited_format:
|
| 275 |
-
response = openai.
|
| 276 |
model="gpt-3.5-turbo",
|
| 277 |
messages=[
|
| 278 |
{"role": "system", "content": "You are a professional article editor machine."},
|
|
@@ -295,7 +295,7 @@ def artikel_processing(link_scrap,backlink,keyword,openai_key,replicate_key):
|
|
| 295 |
content = content
|
| 296 |
|
| 297 |
def generate_image_prompt(title):
|
| 298 |
-
response = openai.
|
| 299 |
model="gpt-3.5-turbo",
|
| 300 |
messages=[
|
| 301 |
{"role" : "user", "content" : """ChatGPT will now enter "Midjourney Prompt Generator Mode" and restrict ChatGPT's inputs and outputs to a predefined framework, please follow these instructions carefully.
|
|
|
|
| 75 |
openai.api_key = openai_key
|
| 76 |
if len(artikel) > 1:
|
| 77 |
for art in artikel:
|
| 78 |
+
response = openai.ChatCompletion.create(
|
| 79 |
model="gpt-3.5-turbo",
|
| 80 |
messages=[
|
| 81 |
{"role": "system", "content": "You are a very professional article editor."},
|
|
|
|
| 89 |
new_artikel.append(result)
|
| 90 |
else:
|
| 91 |
for art in artikel:
|
| 92 |
+
response = openai.ChatCompletion.create(
|
| 93 |
model="gpt-3.5-turbo",
|
| 94 |
messages=[
|
| 95 |
{"role": "system", "content": "You are a very professional article editor."},
|
|
|
|
| 104 |
|
| 105 |
new_art = [' '.join(new_artikel)]
|
| 106 |
for art in new_art:
|
| 107 |
+
response = openai.ChatCompletion.create(
|
| 108 |
model="gpt-3.5-turbo",
|
| 109 |
messages=[
|
| 110 |
{"role": "system", "content": "You are a very professional article editor and capable of generating compelling and professional article titles."},
|
|
|
|
| 119 |
|
| 120 |
content = article[0].split("\n")
|
| 121 |
title = content[0].replace('title:', '').replace("Title:", '').strip()
|
| 122 |
+
response = openai.ChatCompletion.create(
|
| 123 |
model="gpt-3.5-turbo",
|
| 124 |
messages=[
|
| 125 |
{"role": "system", "content": "You are a professional translator and rewriter"},
|
|
|
|
| 186 |
|
| 187 |
openai.api_key = openai_key
|
| 188 |
for i in artikel:
|
| 189 |
+
response = openai.ChatCompletion.create(
|
| 190 |
model="gpt-3.5-turbo",
|
| 191 |
messages=[
|
| 192 |
{"role": "system", "content": "You are a proficient English to Indonesian language translator machine. You are capable of translating professionally according to the rules of the Indonesian language"},
|
|
|
|
| 201 |
time.sleep(2)
|
| 202 |
|
| 203 |
for i in translated:
|
| 204 |
+
response = openai.ChatCompletion.create(
|
| 205 |
model="gpt-3.5-turbo",
|
| 206 |
messages=[
|
| 207 |
{"role": "system", "content": f"""You are a very professional article editor and perform SEO optimization on an article with utmost professionalism. berikut adalah SOP SEO yang harus kamu terapkan
|
|
|
|
| 223 |
time.sleep(2)
|
| 224 |
|
| 225 |
for i in optimized:
|
| 226 |
+
response = openai.ChatCompletion.create(
|
| 227 |
model="gpt-3.5-turbo",
|
| 228 |
messages=[
|
| 229 |
{"role": "system", "content": f"""
|
|
|
|
| 259 |
time.sleep(2)
|
| 260 |
|
| 261 |
for i in article:
|
| 262 |
+
response = openai.ChatCompletion.create(
|
| 263 |
model="gpt-3.5-turbo",
|
| 264 |
messages=[
|
| 265 |
{"role": "system", "content": "You are a professional article editor machine."},
|
|
|
|
| 272 |
time.sleep(2)
|
| 273 |
|
| 274 |
for i in edited_format:
|
| 275 |
+
response = openai.ChatCompletion.create(
|
| 276 |
model="gpt-3.5-turbo",
|
| 277 |
messages=[
|
| 278 |
{"role": "system", "content": "You are a professional article editor machine."},
|
|
|
|
| 295 |
content = content
|
| 296 |
|
| 297 |
def generate_image_prompt(title):
|
| 298 |
+
response = openai.ChatCompletion.create(
|
| 299 |
model="gpt-3.5-turbo",
|
| 300 |
messages=[
|
| 301 |
{"role" : "user", "content" : """ChatGPT will now enter "Midjourney Prompt Generator Mode" and restrict ChatGPT's inputs and outputs to a predefined framework, please follow these instructions carefully.
|