
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
Dall-e 3 를 사용하여 chatgpt에게 prompt를 전달 하는 코드에서
수업시간에는
def generate_response(prompt, size):
gpt_prompt = [
{"role": "system", "content": "Imagine the details of the input's appearance. Please respond briefly."},
{"role": "user", "content": prompt}
]
이렇게 코드를 사용하다가 langchain으로 번역기능을 사용하여 user가 입력한 prompt를 번역하여
translate_prompt = translate_text(prompt)
gpt_prompt = [
{"role": "system", "content": "Imagine the details of the input's appearance. Please respond briefly."},
{"role": "user", "content": translate_prompt}
]
번역된 prompt를 chatgpt에게 전달하였습니다.
과제에서는 기본 코드가 제공이 되었어요.
# 아래 코드를 수정해 보세요!
def generate_contents(prompt, size):
translated_prompt = translate_text(prompt)
# content 부분에는 이미지를 생성할 AI의 역할을 설정해 주면 되겠죠?
img_prompt = [
{"role": "system",
"content": ""},
{"role": "user", "content": f"(realistic){prompt}"}
]
번역은 하지만 번역된 prompt를 사용하지 않고
f"(realistic){prompt}"
요렇게 사용하는데요 이문구에 대한 설명을 좀 해주시겠어요?
