Spaces:
Runtime error
Runtime error
bug
Browse files
app.py
CHANGED
@@ -200,13 +200,14 @@ async def generate_article_anyscale(model, prompt, user_prompt):
|
|
200 |
|
201 |
|
202 |
async def generate_articles(title):
|
203 |
-
|
204 |
model="gpt-3.5-turbo-0125",
|
205 |
messages=[
|
206 |
{"role": "system", "content": "You are a helpful English translator"},
|
207 |
{"role": "user", "content": f"Help me to translate this to English:{title}."}
|
208 |
]
|
209 |
)
|
|
|
210 |
|
211 |
user_prompt= f"Siguiendo tus instrucciones y referencias redacta un artículo basado en el siguiente título. Título:'{title}'. Artículo:"
|
212 |
en_user_promt= f"Following your instructions and references, write an article based on the following title. Title: '{en_title}'. Article:"
|
|
|
200 |
|
201 |
|
202 |
async def generate_articles(title):
|
203 |
+
completion = openai_client.chat.completions.create(
|
204 |
model="gpt-3.5-turbo-0125",
|
205 |
messages=[
|
206 |
{"role": "system", "content": "You are a helpful English translator"},
|
207 |
{"role": "user", "content": f"Help me to translate this to English:{title}."}
|
208 |
]
|
209 |
)
|
210 |
+
en_title = completion.choices[0].message.content
|
211 |
|
212 |
user_prompt= f"Siguiendo tus instrucciones y referencias redacta un artículo basado en el siguiente título. Título:'{title}'. Artículo:"
|
213 |
en_user_promt= f"Following your instructions and references, write an article based on the following title. Title: '{en_title}'. Article:"
|