diff --git a/WATSONX/.gradio/flagged/dataset1.csv b/WATSONX/.gradio/flagged/dataset1.csv new file mode 100644 index 0000000..2ec39ac --- /dev/null +++ b/WATSONX/.gradio/flagged/dataset1.csv @@ -0,0 +1,12 @@ +키,몸무게,BMI 판정,timestamp +173,85,"당신의 BMI 지수는 키 : 173, 몸무게 : 85, 판정 : 비만",2026-05-15 16:47:09.270006 +173,85,"당신의 BMI 지수는 키 : 173, 몸무게 : 85, 판정 : 비만",2026-05-15 16:47:10.782534 +173,85,"당신의 BMI 지수는 키 : 173, 몸무게 : 85, 판정 : 비만",2026-05-15 16:47:12.258788 +200,85,"당신의 BMI 지수는 키 : 200, 몸무게 : 85, 판정 : 정상체중",2026-05-15 16:47:27.687789 +200,85,"당신의 BMI 지수는 키 : 200, 몸무게 : 85, 판정 : 정상체중",2026-05-15 16:50:13.135872 +200,1090,"당신의 BMI 지수는 키 : 200, 몸무게 : 85, 판정 : 정상체중",2026-05-15 16:50:16.877887 +200,1090,"당신의 BMI 지수는 키 : 200, 몸무게 : 85, 판정 : 정상체중",2026-05-15 16:50:18.833742 +,,,2026-05-15 16:50:23.320214 +,,,2026-05-15 16:50:24.862371 +,,,2026-05-15 16:50:26.797623 +124,21,,2026-05-15 16:50:29.805917 diff --git a/WATSONX/.gradio/flagged/dataset2.csv b/WATSONX/.gradio/flagged/dataset2.csv new file mode 100644 index 0000000..ad68780 --- /dev/null +++ b/WATSONX/.gradio/flagged/dataset2.csv @@ -0,0 +1,8 @@ +image,output,timestamp +.gradio/flagged/image/6d40714a1a97620c4003/스크린샷 2026-05-15 오후 2.46.33.png,,2026-05-15 16:54:31.487199 +.gradio/flagged/image/32bf3df6a53702a1bc81/스크린샷 2026-05-15 오후 2.46.33.png,"' + 이미지 분석 결과 + - 가로 : 1032px + - 세로 : 471px + - 이미지 모드 : RGB + ",2026-05-15 16:58:37.038848 diff --git a/WATSONX/.gradio/flagged/dataset3.csv b/WATSONX/.gradio/flagged/dataset3.csv new file mode 100644 index 0000000..7d726c1 --- /dev/null +++ b/WATSONX/.gradio/flagged/dataset3.csv @@ -0,0 +1,2 @@ +제품명,브랜드명,제품 특징,톤앤매너,필수 포함 키워드,브랜드 핵심 가치,output,timestamp +ㅁㅁ,,,,,,,2026-05-18 11:13:46.852604 diff --git a/WATSONX/.gradio/flagged/dataset4.csv b/WATSONX/.gradio/flagged/dataset4.csv new file mode 100644 index 0000000..888d351 --- /dev/null +++ b/WATSONX/.gradio/flagged/dataset4.csv @@ -0,0 +1,35 @@ +여행 지역,예산(만원),여행 스타일,traval range,output,timestamp +지옥,300,휴양,1week~,"제가 여행 스캐줄러 AI로서 여행 계획을 짜겠습니다. + +목적지: 지옥 + +여행 스타일: 휴양 + +기간: 1주일 + +비용: 300 + +휴양을 위한 지옥 여행 계획: + +1일차: + * 출발 후 지옥 도착 (교통수단: 불편한 화산 배) + * 체크인 후 경치 좋은 호텔/리조트에서 휴식 + * 지옥같은 해변에서 아름다운 석양 감상 및 따뜻한 해수욕 + +2일차: + * 지옥의 불타오르는 숲을 탐험하기 위한 일일 투어 시작 + * 야생 동물 관찰 및 식물 멀티미디어 가이드 투어 + * 소박한 지옥 요리를 즐길 수 있는 현지 레스토랑에서 저녁 식사 + +3일차: + * 내부 지호강을 탐험하기 위해 지옥의 유일한 지하철 라인을 이용하여 강변으로 이동 + * 지옥의 역사와 문화에 대해 배울 수 있는 지역 박물관 방문 + * 지옥의 남쪽 지역 발견을 위한 야외 야경 투어 + +4일차: + * 숲 속에 위치한 지옥의 풍경이 아름다운 수상 골프 코스에서 골프 플레이 + * 식사와 즐거운 시간을 보낼 수 있는 지옥 스타일의 스파 & 웰빙 센터에서 휴식 + * 현지 음악을 듣고 현지인들과 함께 즐기는 지옥의 전통 댄스 파티 + +5일차: + * 불타는 빙하 동굴 탐험을 위해 조용한 스노",2026-05-18 17:01:25.733778 diff --git a/WATSONX/.gradio/flagged/image/32bf3df6a53702a1bc81/스크린샷 2026-05-15 오후 2.46.33.png b/WATSONX/.gradio/flagged/image/32bf3df6a53702a1bc81/스크린샷 2026-05-15 오후 2.46.33.png new file mode 100644 index 0000000..4fd0782 Binary files /dev/null and b/WATSONX/.gradio/flagged/image/32bf3df6a53702a1bc81/스크린샷 2026-05-15 오후 2.46.33.png differ diff --git a/WATSONX/.gradio/flagged/image/6d40714a1a97620c4003/스크린샷 2026-05-15 오후 2.46.33.png b/WATSONX/.gradio/flagged/image/6d40714a1a97620c4003/스크린샷 2026-05-15 오후 2.46.33.png new file mode 100644 index 0000000..4fd0782 Binary files /dev/null and b/WATSONX/.gradio/flagged/image/6d40714a1a97620c4003/스크린샷 2026-05-15 오후 2.46.33.png differ diff --git a/WATSONX/ad.py b/WATSONX/ad.py new file mode 100644 index 0000000..9d66425 --- /dev/null +++ b/WATSONX/ad.py @@ -0,0 +1,76 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-4-h-small", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + + +def ad_text(name, brand_name, strength, tone, keyword, value): + + + + system_prompt = """ + 1. SWOT 분석하여 광고 문구 작성해줘 + """ + + + user_prompt=f""" + 아래 내용을 참고해서 1~2줄짜리 광고 문구 5개 작성해줘. + - 제품명 : {name} + - 브랜드명 : {brand_name} + - 제품특징 : {strenghth} + - 톤앤매너 : {tone} + - 브랜드 핵심 가치 : {value} + - 필수 포함 키워드 : {keyword} + """ + + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + {"role" : "user", "content" : user_prompt}, + ] + + generated_response = model.chat(messages=messages) + return print(generated_response['choices'][0]['message']['content']) + +demo = gr.Interface( + fn=ad_text, + inputs=[gr.Text(label = "제품명"), + gr.Text(label = "브랜드명"), + gr.Text(label = "제품 특징"), + gr.Text(label = "톤앤매너"), + gr.Text(label = "필수 포함 키워드"), + gr.Text(label = "브랜드 핵심 가치"), + ], + + outputs=[gr.Markdown()], + title="광고 문구 프로그램", + description="텍스트 입력 시 ai가 광고 문구를 작생해 드립니다." +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/app1.py b/WATSONX/app1.py new file mode 100644 index 0000000..a8341f8 --- /dev/null +++ b/WATSONX/app1.py @@ -0,0 +1,13 @@ +import gradio as gr + +def greet(name, intensity): + return "Hello, " + name + "!" * int(intensity) + +demo = gr.Interface( + fn=greet, + inputs=["text", "slider"], + outputs=["text"], + api_name="predict" +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/app2.py b/WATSONX/app2.py new file mode 100644 index 0000000..a7f0729 --- /dev/null +++ b/WATSONX/app2.py @@ -0,0 +1,13 @@ +import gradio as gr + +def greet(name, grade): + return name + "⭐" * int(grade) + +demo = gr.Interface( + fn=greet, + inputs=[gr.Text(label = "음식명"), gr.Slider(1, 5, step=1, label = "만족도")], + outputs=[gr.Text(label= "만족도 출력")], + api_name="별점 리뷰 생성" +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/app3.py b/WATSONX/app3.py new file mode 100644 index 0000000..c8ff9d1 --- /dev/null +++ b/WATSONX/app3.py @@ -0,0 +1,25 @@ +import gradio as gr + +def bmi_calculator(height, weight): + bmi = weight / (float(height / 100) ** 2) + + if bmi < 18.5 : + result = "저체중" + elif bmi < 22.9 : + result = "정상체중" + elif bmi < 24.9 : + result = "과체중" + else : + result = "비만" + + # 당신의 BMI 지수는 키 : 158, 몸무게 : 60, 판정 : 저체중 + return f"당신의 BMI 지수는 키 : {height}, 몸무게 : {weight}, 판정 : {result}" + +demo = gr.Interface( + fn=bmi_calculator, + inputs=[gr.Number(label = "키"), gr.Number(label = "몸무게")], + outputs=[gr.Text(label= "BMI 판정")], + api_name="BMI 측정기" +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/app4.py b/WATSONX/app4.py new file mode 100644 index 0000000..da1341f --- /dev/null +++ b/WATSONX/app4.py @@ -0,0 +1,16 @@ +import gradio as gr + +def predict(image): + # 이미지 width, height 정보 리턴 + width, height = image.size + + return f""" + 이미지 분석 결과 + - 가로 : {width}px + - 세로 : {height}px + - 이미지 모드 : {image.mode} + """ + + +interface = gr.Interface(predict, gr.Image(type="pil"), gr.Textbox()) +interface.launch() \ No newline at end of file diff --git a/WATSONX/app5.py b/WATSONX/app5.py new file mode 100644 index 0000000..11cfbc9 --- /dev/null +++ b/WATSONX/app5.py @@ -0,0 +1,16 @@ +import gradio as gr + +def process_image(editor_value): + ''' + composite : 원본 그림 위에 레이어 반영한 최종 이미지 + ''' + + image = editor_value['composite'] + enhancer = ImageEnhance.Brightness(image) + result = enhancer.enhance(1.5) + + return result + + +interface = gr.Interface(process_image, gr.ImageEditor(type="pil"), gr.Image()) +interface.launch() \ No newline at end of file diff --git a/WATSONX/app6.py b/WATSONX/app6.py new file mode 100644 index 0000000..2dfd176 --- /dev/null +++ b/WATSONX/app6.py @@ -0,0 +1,14 @@ +import gradio as gr + +def greet(name): + return "Hello " + name + "!" + + +with gr.Blocks() as demo: + with gr.Row(): + name = gr.Textbox(label="Name") + output = gr.Textbox(label="Output Box") + greet_btn = gr.Button("Greet") + greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet") + +demo.launch() \ No newline at end of file diff --git a/WATSONX/app7.py b/WATSONX/app7.py new file mode 100644 index 0000000..9187357 --- /dev/null +++ b/WATSONX/app7.py @@ -0,0 +1,49 @@ +import gradio as gr # 1. 'gr' 정의 (NameError 해결) + +# 응원 함수 +def cheer(name, level): + return f"{name} 화이팅! " + "🥳" * int(level) + +# 별점 함수 +def review(name, grade): + return f"{name} " + "⭐" * int(grade) + +# BMI 함수 +def bmi_calculator(height, weight): + if not height or not weight: # 입력값이 없을 때 방어 + return "키와 몸무게를 모두 입력해주세요." + + bmi = weight / ((height / 100) ** 2) + + if bmi < 18.5: result = "저체중" + elif bmi < 22.9: result = "정상체중" + elif bmi < 24.9: result = "과체중" + else: result = "비만" + + return f"결과: {result} (BMI: {bmi:.2f})" + +# 인터페이스 구성 +with gr.Blocks() as demo: + gr.Markdown("# 통합 도구 모음") + + with gr.Tab("응원"): + c_name = gr.Textbox(label="이름") + c_level = gr.Slider(1, 5, step=1, label="응원강도") + c_out = gr.Textbox(label="결과") + gr.Button("보내기").click(fn=cheer, inputs=[c_name, c_level], outputs=c_out) + + with gr.Tab("별점"): + r_name = gr.Textbox(label="음식명") + r_grade = gr.Slider(1, 5, step=1, label="만족도") + r_out = gr.Textbox(label="리뷰 결과") + # 2. 여기서 inputs에 r_name과 r_grade 두 개를 정확히 넣어줘야 합니다! + gr.Button("등록").click(fn=review, inputs=[r_name, r_grade], outputs=r_out) + + with gr.Tab("BMI"): + h = gr.Number(label="키(cm)") + w = gr.Number(label="몸무게(kg)") + b_out = gr.Textbox(label="판정 결과") + gr.Button("계산").click(fn=bmi_calculator, inputs=[h, w], outputs=b_out) + +# 3. 마지막에 괄호()를 붙여서 실행 +demo.launch() \ No newline at end of file diff --git a/WATSONX/app8.py b/WATSONX/app8.py new file mode 100644 index 0000000..46413d5 --- /dev/null +++ b/WATSONX/app8.py @@ -0,0 +1,11 @@ +import gradio as gr + + +def echo(message, history): + return message + + +demo = gr.ChatInterface( + fn=echo, examples=["hello", "hola", "merhaba"], title="Echo Bot" +) +demo.launch() \ No newline at end of file diff --git a/WATSONX/code_generation.py b/WATSONX/code_generation.py new file mode 100644 index 0000000..fec446b --- /dev/null +++ b/WATSONX/code_generation.py @@ -0,0 +1,84 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-8b-code-instruct", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + + +def code_text(text): + + + system_prompt = """ + 너는 코드 전문가임 + + 사용자의 욕구사항을 분석하여 : + - 정확한 코드 + - 실행 가능한 코드 + - 가독성이 좋은 코드 + - 초보자도 이해할 수 있는 설명 + 을 제공하세요. + + [규칙] + 1. 반드시 코드 블록('''')형식으로 작성 + 2. 코드에는 적절한 주석 포함 + 3. 필요한 라이브러리가 있다면 함께 설명 + 4. 코드 동작 원리를 간단히 설명 + 5. 오류 가능성이 있는 부분은 주의사항 추가 + 6. 사용자의 요청 언어(python, javascript 등)에 맞춰 작성 + 7. 불필요하게 긴 설명은 피하고 핵심 위주로 작성 + + [응답 형식] + 1. 기능설명 + 2. 코드 + 3. 코드설명 + 4. 실행 결과 또는 사용 예시 + """ + + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + {"role" : "user", "content" : text}, + ] + + generated_response = model.chat(messages=messages) + return generated_response['choices'][0]['message']['content'] + +demo = gr.Interface( + fn=code_text, + inputs=[ + gr.Textbox(lines=10, label = "코드입력", placeholder="여기에 코드를 입력해주세요."), + + ], + + outputs=[gr.Markdown()], + title="코드 작성 프로그램", + description="코드를 AI가 작성해드립니다." +) + +demo.launch() + diff --git a/WATSONX/example.py b/WATSONX/example.py new file mode 100644 index 0000000..13f269c --- /dev/null +++ b/WATSONX/example.py @@ -0,0 +1,23 @@ +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference + +credentials = Credentials( + url = "{watsonx_ai_url}", + api_key = "{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-13b-instruct-v2", + api_client=client, + project_id="{project_id}", + params = { + "max_new_tokens": 100 + } + ) + +prompt = 'How far is Paris from Bangalore?' + +print(model.generate(prompt)) +print(model.generate_text(prompt)) diff --git a/WATSONX/image.py b/WATSONX/image.py new file mode 100644 index 0000000..119efac --- /dev/null +++ b/WATSONX/image.py @@ -0,0 +1,112 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr +import base64 +import io +import logging + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="meta-llama/llama-3-2-11b-vision-instruct", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 3000 + } +) + +def image_to_base64(image): + """ + pillow 형식의 이미지를 가져와 원하는 포맷으로 저장 + base64 인코딩 형식으로 이미지 리턴 + """ + + buffer = io.BytesIO() + image.save(buffer, format="PNG") + + + image_base64 = base64.b64encode(buffer.getvalue()).decode('utf-8') + return image_base64 + +def image_text(image, user_prompt): + + if image is None: + return "이미지를 입력해 주세요" + + # base64 + base64_image = image_to_base64(image) + + + system_prompt = """ + 당신은 이미지 분석 전문가입니다. + 사용자의 요청에 따라 이미지를 분석하세요. + - 이미지 설명 + - 분위기 분석 + - 감정 분석 + - 객체 설명 + - 캡션 생성 + - 여행 추천 + - 스타일 분석 + + 등을 수행하세요 + + 항상: + - 한국어로 답변 + - 사용자의 요청 의도를 우선 반영 + - 읽기 쉽게 작성 + """ + + if user_prompt is None: + user_prompt = f""" + 이미지를 분석해줘. + """ + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + {"role" : "user", "content" : [ + { + "type": "image_url", + "image_url": { + "url": f"data:image/png;base64,{base64_image}" + } + }, + { + "type": "text", + "text": user_prompt + }, + ], + } + ] + + generated_response = model.chat(messages=messages) + return generated_response['choices'][0]['message']['content'] + +demo = gr.Interface( + fn=image_text, + inputs=[gr.Image(type="pil"), + gr.Text(label="유저 명령"), + ], + + outputs=[gr.Markdown()], + title="이미지 분석 프로그램", + description="이미지 업로드 시 AI가 이미지 분석" +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/image/gorong.png b/WATSONX/image/gorong.png new file mode 100644 index 0000000..10c54ce Binary files /dev/null and b/WATSONX/image/gorong.png differ diff --git a/WATSONX/image/test.png b/WATSONX/image/test.png new file mode 100644 index 0000000..d3ed521 Binary files /dev/null and b/WATSONX/image/test.png differ diff --git a/WATSONX/interview.py b/WATSONX/interview.py new file mode 100644 index 0000000..967ff7f --- /dev/null +++ b/WATSONX/interview.py @@ -0,0 +1,71 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr + +import logging + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-4-h-small", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + + +def interview_text(genre): + + + system_prompt = """ + 인터뷰를 한다고 생각하고 대상의 주제를 가지고 일단 핵심 내용을 정리하고 인터뷰 질문을 생성해줘. + """ + + + user_prompt=f""" + 아래 내용 참고해서 + 1. 장르 특징 5줄 정리 + 2. 인터뷰 질문 8개 작성해줘 + - genre : {genre} + """ + + print(genre) + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + {"role" : "user", "content" : user_prompt}, + ] + + generated_response = model.chat(messages=messages) + return generated_response['choices'][0]['message']['content'] + +demo = gr.Interface( + fn=interview_text, + inputs=[gr.Text(label = "genre"), + + ], + + outputs=[gr.Markdown()], + title="인터뷰 질문 생성 프로그램", + description="질문 생성" +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/summary.py b/WATSONX/summary.py new file mode 100644 index 0000000..75f04e8 --- /dev/null +++ b/WATSONX/summary.py @@ -0,0 +1,65 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-4-h-small", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + + +def summarize_text(text): + + if not text.strip(): + return "텍스트를 입력해주세요." + + instructions = """ + 당신은 텍스트를 한국어로 요악하는 전문가이빈다. + - 당신의 임무는 아래 주어진 텍스트 문장을 한국어로 요약하는 것입니다. + - 요약 시 다음 사항을 반드시 반영해야 합니다. + - 중복된 내용은 생략하되, 반복되는 내용은 요약해서 더 강조합니다. + - 사례 중심보다는 개념과 주장 중심으로 요약합니다. + - 3줄 이내로 요약합니다. + - 블릿 기호 형식으로 작성합니다. + """ + + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : instructions}, + {"role" : "user", "content" : text}, + ] + + generated_response = model.chat(messages=messages) + return print(generated_response['choices'][0]['message']['content']) + +demo = gr.Interface( + fn=summarize_text, + inputs=[gr.TextArea(lines=10, placeholder="요약할 내용의 텍스트 입력..", label="입력")], + outputs=[gr.Markdown()], + title="watsonx 기반의 요약 프로그램", + description="텍스트 입력 시 ai 요약" +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/travel.py b/WATSONX/travel.py new file mode 100644 index 0000000..e79ebf9 --- /dev/null +++ b/WATSONX/travel.py @@ -0,0 +1,83 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr + +import logging + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-4-h-small", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + + +def recommend(local, money, style, day): + + system_prompt = """ + 너는 여행 스캐줄러 AI + 한글로 답변해주고 + 여행사의 여행 스케쥴 처럼 짜줘 + """ + + + user_prompt=f""" + 다음 내용을 참고해서 계획 짜줘 + - 지역 : {local} + - 비용 :{money} + - 여행 스타일 : {style} + - 기간 :{day} + """ + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + {"role" : "user", "content" : user_prompt}, + ] + + # generated_response = model.chat(messages=messages) + # return generated_response['choices'][0]['message']['content'] + + # chat_stream() + generated_response = model.chat_stream(messages=messages) + + full_response = "" + for chunk in generated_response: + if chunk['choices'] : + full_response += chunk["choices"][0]["delta"].get("content", "") + yield full_response + +demo = gr.Interface( + fn=recommend, + inputs=[ + gr.Text(label = "여행 지역"), + gr.Slider(10, 300, label="예산(만원)"), + gr.Dropdown(["모험", "휴양", "문화", "음식", "액티비티"], label="여행 스타일"), + gr.Radio(["1day", "2~3day", "4~7day", "1week~"], label="traval range"), + ], + + outputs=[gr.Textbox(lines=5)], + title="AI 여행 플래너", + description="여행지역, 예산, 여행스타일, 여행 기간 등을 입력하면 AI가 맞춤형 여행일정을 추천해 드립니다." +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/travel2.py b/WATSONX/travel2.py new file mode 100644 index 0000000..01664aa --- /dev/null +++ b/WATSONX/travel2.py @@ -0,0 +1,80 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr + +import logging + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="ibm/granite-4-h-small", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + + +def recommend(message, history): + + print("history :", history) + + system_prompt = """ + 너는 여행 스캐줄러 AI + 한글로 답변해주고 + 여행사의 여행 스케쥴 처럼 짜줘 + """ + + + user_prompt=f""" + 다음 내용을 참고해서 계획 짜줘 + - 내용 : {message} + """ + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + # {"role" : "user", "content" : user_prompt}, + ] + + for item in history: + content = item["content"][0]["text"] + messages.append({"role" : item["role"], "content" : content}) + + messages.append({"role" : "user", "content" : message}) + + # generated_response = model.chat(messages=messages) + # return generated_response['choices'][0]['message']['content'] + + # chat_stream() + generated_response = model.chat_stream(messages=messages) + + full_response = "" + for chunk in generated_response: + if chunk['choices'] : + full_response += chunk["choices"][0]["delta"].get("content", "") + yield full_response + +demo = gr.ChatInterface( + fn=recommend, + title="AI 여행 플래너", + description="여행지역, 예산, 여행스타일, 여행 기간 등을 입력하면 AI가 맞춤형 여행일정을 추천해 드립니다." +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/travel3.py b/WATSONX/travel3.py new file mode 100644 index 0000000..51bcc3d --- /dev/null +++ b/WATSONX/travel3.py @@ -0,0 +1,139 @@ +from dotenv import load_dotenv +import os + +from ibm_watsonx_ai import APIClient +from ibm_watsonx_ai import Credentials +from ibm_watsonx_ai.foundation_models import ModelInference +import gradio as gr +from PIL import Image +import base64 +import io + +import logging + +# .env 내용 가져오기 +load_dotenv() + +apikey = os.getenv("WATSONX_API_KEY") +project_id = os.getenv("WATSONX_PROJECT_ID") +watsonx_ai_url = os.getenv("WATSONX_URL") + +credentials = Credentials( + url = f"{watsonx_ai_url}", + api_key = f"{apikey}", +) +client = APIClient(credentials) + +model = ModelInference( + model_id="meta-llama/llama-3-2-11b-vision-instruct", + api_client=client, + project_id=f"{project_id}", + params = { + "max_tokens": 1000 + } +) + +# 💡 복복형 이미지 변환 함수 추가 +def image_to_base64(image): + buffer = io.BytesIO() + image.save(buffer, format="PNG") + return base64.b64encode(buffer.getvalue()).decode('utf-8') + + +def recommend(message, history): + + print("history :", history) + + system_prompt = """ + 너는 여행 스캐줄러 AI + + + 사용자가 업로드한 이미지의 + - 분위기 + - 감성 + - 색감 + - 스타일 + 을 분석해서 여행지를 추천해줘 + + 반드시 + 1. 이미지 분위기 분석 + 2. 추천 여행지 + 3. 추천 이유 + 4. 추천 활동 + 5. 한글로 답변 + """ + + user_prompt=f""" + 다음 내용을 참고해서 계획 짜줘 + - 내용 : {message} + """ + + messages = [ + # 시스템 프롬프트 + {"role" : "system", "content" : system_prompt}, + # {"role" : "user", "content" : user_prompt}, + ] + + for item in history: + role = item["role"] + content = item["content"] + + # assistant answer save + texts = [] + + if isinstance(content, list): + for c in content: + + # 텍스트만 추출 + if c.get("type") == "text": + texts.append(c.get("text", "")) + + elif isinstance(content, str): + texts.append(content) + + messages.append({"role" : role, "content" : " ".join(texts)}) + + # messages : text, files + text = message.get('text', '') + files = message.get('files', '') + + if files: + image = Image.open(files[0]) + + base64_image = image_to_base64(image) + + # 💡 2. 공중에 떠 있던 딕셔너리를 messages.append()로 정상 추가합니다. + messages.append({ + "role" : "user", + "content" : [ + { + "type": "image_url", + "image_url": {"url": f"data:image/png;base64,{base64_image}"} + }, + { "type": "text", "text": user_prompt }, + ], + }) + + else: + messages = [{"role" : "user", "content" : text}] + + # generated_response = model.chat(messages=messages) + # return generated_response['choices'][0]['message']['content'] + + # chat_stream() + generated_response = model.chat_stream(messages=messages) + + full_response = "" + for chunk in generated_response: + if chunk['choices'] : + full_response += chunk["choices"][0]["delta"].get("content", "") + yield full_response + +demo = gr.ChatInterface( + fn=recommend, + multimodal=True, + title="AI 여행 플래너", + description="여행지역, 예산, 여행스타일, 여행 기간 등을 입력하면 AI가 맞춤형 여행일정을 추천해 드립니다." +) + +demo.launch() \ No newline at end of file diff --git a/WATSONX/watson.ipynb b/WATSONX/watson.ipynb new file mode 100644 index 0000000..48679ac --- /dev/null +++ b/WATSONX/watson.ipynb @@ -0,0 +1,2974 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "3d939242", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: python-dotenv in ./lib/python3.12/site-packages (1.2.2)\n", + "Requirement already satisfied: ibm-watsonx-ai in ./lib/python3.12/site-packages (1.5.11)\n", + "Requirement already satisfied: requests in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (2.34.2)\n", + "Requirement already satisfied: httpx<0.29,>=0.27 in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (0.28.1)\n", + "Requirement already satisfied: urllib3 in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (2.7.0)\n", + "Requirement already satisfied: pandas<2.4.0,>=0.24.2 in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (2.3.3)\n", + "Requirement already satisfied: certifi in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (2026.4.22)\n", + "Requirement already satisfied: lomond in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (0.3.3)\n", + "Requirement already satisfied: tabulate in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (0.10.0)\n", + "Requirement already satisfied: packaging in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (26.2)\n", + "Requirement already satisfied: ibm-cos-sdk<2.15.0,>=2.12.0 in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (2.14.3)\n", + "Requirement already satisfied: cachetools in ./lib/python3.12/site-packages (from ibm-watsonx-ai) (7.1.1)\n", + "Requirement already satisfied: anyio in ./lib/python3.12/site-packages (from httpx<0.29,>=0.27->ibm-watsonx-ai) (4.13.0)\n", + "Requirement already satisfied: httpcore==1.* in ./lib/python3.12/site-packages (from httpx<0.29,>=0.27->ibm-watsonx-ai) (1.0.9)\n", + "Requirement already satisfied: idna in ./lib/python3.12/site-packages (from httpx<0.29,>=0.27->ibm-watsonx-ai) (3.15)\n", + "Requirement already satisfied: h11>=0.16 in ./lib/python3.12/site-packages (from httpcore==1.*->httpx<0.29,>=0.27->ibm-watsonx-ai) (0.16.0)\n", + "Requirement already satisfied: ibm-cos-sdk-core==2.14.3 in ./lib/python3.12/site-packages (from ibm-cos-sdk<2.15.0,>=2.12.0->ibm-watsonx-ai) (2.14.3)\n", + "Requirement already satisfied: ibm-cos-sdk-s3transfer==2.14.3 in ./lib/python3.12/site-packages (from ibm-cos-sdk<2.15.0,>=2.12.0->ibm-watsonx-ai) (2.14.3)\n", + "Requirement already satisfied: jmespath<=1.0.1,>=0.10.0 in ./lib/python3.12/site-packages (from ibm-cos-sdk<2.15.0,>=2.12.0->ibm-watsonx-ai) (1.0.1)\n", + "Requirement already satisfied: python-dateutil<3.0.0,>=2.9.0 in ./lib/python3.12/site-packages (from ibm-cos-sdk-core==2.14.3->ibm-cos-sdk<2.15.0,>=2.12.0->ibm-watsonx-ai) (2.9.0.post0)\n", + "Requirement already satisfied: numpy>=1.26.0 in ./lib/python3.12/site-packages (from pandas<2.4.0,>=0.24.2->ibm-watsonx-ai) (2.4.4)\n", + "Requirement already satisfied: pytz>=2020.1 in ./lib/python3.12/site-packages (from pandas<2.4.0,>=0.24.2->ibm-watsonx-ai) (2026.2)\n", + "Requirement already satisfied: tzdata>=2022.7 in ./lib/python3.12/site-packages (from pandas<2.4.0,>=0.24.2->ibm-watsonx-ai) (2026.2)\n", + "Requirement already satisfied: six>=1.5 in ./lib/python3.12/site-packages (from python-dateutil<3.0.0,>=2.9.0->ibm-cos-sdk-core==2.14.3->ibm-cos-sdk<2.15.0,>=2.12.0->ibm-watsonx-ai) (1.17.0)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in ./lib/python3.12/site-packages (from requests->ibm-watsonx-ai) (3.4.7)\n", + "Requirement already satisfied: typing_extensions>=4.5 in ./lib/python3.12/site-packages (from anyio->httpx<0.29,>=0.27->ibm-watsonx-ai) (4.15.0)\n" + ] + } + ], + "source": [ + "!pip install python-dotenv\n", + "!pip install ibm-watsonx-ai" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "2edbeba1", + "metadata": {}, + "outputs": [], + "source": [ + "from dotenv import load_dotenv\n", + "import os\n", + "\n", + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import ModelInference" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "119eef9c", + "metadata": {}, + "outputs": [], + "source": [ + "# .env 내용 가져오기\n", + "load_dotenv()\n", + "\n", + "apikey = os.getenv(\"WATSONX_API_KEY\")\n", + "project_id = os.getenv(\"WATSONX_PROJECT_ID\")\n", + "watsonx_ai_url = os.getenv(\"WATSONX_URL\")" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "0c5fe481", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'GRANITE_4_H_SMALL': 'ibm/granite-4-h-small', 'GRANITE_8B_CODE_INSTRUCT': 'ibm/granite-8b-code-instruct', 'GRANITE_GUARDIAN_3_8B': 'ibm/granite-guardian-3-8b', 'LLAMA_3_2_11B_VISION_INSTRUCT': 'meta-llama/llama-3-2-11b-vision-instruct', 'LLAMA_3_3_70B_INSTRUCT': 'meta-llama/llama-3-3-70b-instruct', 'LLAMA_4_MAVERICK_17B_128E_INSTRUCT_FP8': 'meta-llama/llama-4-maverick-17b-128e-instruct-fp8', 'LLAMA_GUARD_3_11B_VISION': 'meta-llama/llama-guard-3-11b-vision', 'MISTRAL_MEDIUM_2505': 'mistralai/mistral-medium-2505', 'MISTRAL_SMALL_3_1_24B_INSTRUCT_2503': 'mistralai/mistral-small-3-1-24b-instruct-2503', 'GPT_OSS_120B': 'openai/gpt-oss-120b'}\n" + ] + } + ], + "source": [ + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "client.foundation_models.TextModels.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a50971be", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'id': 'chatcmpl-3d46f5e4fde997285a33653d38cf838d', 'object': 'chat.completion', 'model_id': 'ibm/granite-4-h-small', 'model': 'ibm/granite-4-h-small', 'choices': [{'index': 0, 'message': {'role': 'assistant', 'content': 'The distance between Paris, France, and Bangalore, India, can be calculated either by air or by road. Since they are in different continents, traveling by air is the most practical and commonly taken route.\\n\\n1. **Distance by Air (Straight Line):**\\n The straight line distance (also known as great circle distance) from Bangalore to Paris is approximately 7,200 kilometers (or 4,473 miles).\\n\\n2. **Flight Distance:**\\n When accounting for actual flight paths and airport'}, 'finish_reason': 'length'}], 'created': 1779075834, 'model_version': '4.0.0', 'created_at': '2026-05-18T03:43:56.250Z', 'usage': {'completion_tokens': 100, 'prompt_tokens': 26, 'total_tokens': 126}}\n", + "The distance between Paris, France, and Bangalore, India, can be calculated either by air or by road. Since they are in different continents, traveling by air is the most practical and commonly taken route.\n", + "\n", + "1. **Distance by Air (Straight Line):**\n", + " The straight line distance (also known as great circle distance) from Bangalore to Paris is approximately 7,200 kilometers (or 4,473 miles).\n", + "\n", + "2. **Flight Distance:**\n", + " When accounting for actual flight paths and airport\n" + ] + } + ], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import ModelInference\n", + "\n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "model = ModelInference(\n", + " model_id=\"ibm/granite-4-h-small\",\n", + " api_client=client,\n", + " project_id=f\"{project_id}\",\n", + " params = {\n", + " \"max_tokens\": 100\n", + " }\n", + ")\n", + "# 사용자 프롬프트\n", + "prompt = 'How far is Paris from Bangalore?'\n", + "messages = [\n", + " # 시스템 프롬프트\n", + " {\"role\" : \"system\", \"content\" : \"You ar a helpful assistant.\"},\n", + " {\"role\" : \"user\", \"content\" : prompt}, \n", + "]\n", + "\n", + "generated_response = model.chat(messages = messages)\n", + "\n", + "print(generated_response)\n", + "print(generated_response['choices'][0]['message']['content'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "2613e6d1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'GRANITE_4_H_SMALL': 'ibm/granite-4-h-small', 'GRANITE_8B_CODE_INSTRUCT': 'ibm/granite-8b-code-instruct', 'GRANITE_GUARDIAN_3_8B': 'ibm/granite-guardian-3-8b', 'LLAMA_3_2_11B_VISION_INSTRUCT': 'meta-llama/llama-3-2-11b-vision-instruct', 'LLAMA_3_3_70B_INSTRUCT': 'meta-llama/llama-3-3-70b-instruct', 'LLAMA_4_MAVERICK_17B_128E_INSTRUCT_FP8': 'meta-llama/llama-4-maverick-17b-128e-instruct-fp8', 'LLAMA_GUARD_3_11B_VISION': 'meta-llama/llama-guard-3-11b-vision', 'MISTRAL_MEDIUM_2505': 'mistralai/mistral-medium-2505', 'MISTRAL_SMALL_3_1_24B_INSTRUCT_2503': 'mistralai/mistral-small-3-1-24b-instruct-2503', 'GPT_OSS_120B': 'openai/gpt-oss-120b'}\n" + ] + } + ], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "\n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + " )\n", + "\n", + "api_client = APIClient(credentials)\n", + "\n", + "api_client.foundation_models.TextModels.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "29ff5319", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'id': 'chatcmpl-5aa2c5a8afa35e3bbbf9f8b8395ce294', 'object': 'chat.completion', 'model_id': 'ibm/granite-4-h-small', 'model': 'ibm/granite-4-h-small', 'choices': [{'index': 0, 'message': {'role': 'assistant', 'content': '이 문장은 양적 성격의 감정을 포함하고 있습니다. 첫 번째 부분 \"배송은 빨랐다\"는 긍정적인 감정을 나타내고 있으며, 이는 배송이 빠르게 이루어졌다는 평가를 의미합니다. 반면, 나머지'}, 'finish_reason': 'length'}], 'created': 1779075839, 'model_version': '4.0.0', 'created_at': '2026-05-18T03:44:00.224Z', 'usage': {'completion_tokens': 100, 'prompt_tokens': 83, 'total_tokens': 183}}\n", + "이 문장은 양적 성격의 감정을 포함하고 있습니다. 첫 번째 부분 \"배송은 빨랐다\"는 긍정적인 감정을 나타내고 있으며, 이는 배송이 빠르게 이루어졌다는 평가를 의미합니다. 반면, 나머지\n" + ] + } + ], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import ModelInference\n", + "\n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "model = ModelInference(\n", + " model_id=\"ibm/granite-4-h-small\",\n", + " api_client=client,\n", + " project_id=f\"{project_id}\",\n", + " params = {\n", + " \"max_tokens\": 100\n", + " }\n", + ")\n", + "# 사용자 프롬프트\n", + "prompt = '''다음 문장의 감정을 분석해줘.\n", + "배송은 빨랐는데 제품 품질이 너무 별로였어요. '''\n", + "\n", + "messages = [\n", + " # 시스템 프롬프트\n", + " # {\"role\" : \"system\", \"content\" : \"You ar a helpful assistant.\"},\n", + " {\"role\" : \"user\", \"content\" : prompt}, \n", + "]\n", + "\n", + "generated_response = model.chat(messages = messages)\n", + "\n", + "print(generated_response)\n", + "print(generated_response['choices'][0]['message']['content'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "f8f27b13", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'id': 'chatcmpl-26bac97b8dacc018deca82da65e0b6b2', 'object': 'chat.completion', 'model_id': 'ibm/granite-4-h-small', 'model': 'ibm/granite-4-h-small', 'choices': [{'index': 0, 'message': {'role': 'assistant', 'content': '부정'}, 'finish_reason': 'stop'}], 'created': 1779075842, 'model_version': '4.0.0', 'created_at': '2026-05-18T03:44:02.230Z', 'usage': {'completion_tokens': 3, 'prompt_tokens': 117, 'total_tokens': 120}}\n", + "부정\n" + ] + } + ], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import ModelInference\n", + "\n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "model = ModelInference(\n", + " model_id=\"ibm/granite-4-h-small\",\n", + " api_client=client,\n", + " project_id=f\"{project_id}\",\n", + " params = {\n", + " \"max_tokens\": 100\n", + " }\n", + ")\n", + "\n", + "messages = [\n", + " # 시스템 프롬프트\n", + " {\"role\" : \"system\", \"content\" : \"너는 문장의 감성을 긍정, 부정, 중립 중 하나로 분류하는 ai 야\"},\n", + " # 퓨샷\n", + " {\"role\" : \"user\", \"content\" : \"정말 만족스러운 서비스였어요.\"}, \n", + " {\"role\" : \"assistant\", \"content\" : \"긍정\"}, \n", + " {\"role\" : \"user\", \"content\" : \"다시는 이용 안할 것 같아요.\"}, \n", + " {\"role\" : \"assistant\", \"content\" : \"부정.\"}, \n", + " # 사용자 프롬프트\n", + " {\"role\" : \"user\", \"content\" : \"배송이 너무 늦었어요.\"}, \n", + "]\n", + "\n", + "generated_response = model.chat(messages = messages)\n", + "\n", + "print(generated_response)\n", + "print(generated_response['choices'][0]['message']['content'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "b7e317b5", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "페페로니 피자를 만드는 방법은 다음과 같습니다:\n", + "\n", + "재료:\n", + "- 피자 도우 (상점에서 사거나 직접 만듭니다)\n", + "- 토마토 소스\n", + "- 모짜렐라 치즈\n", + "- 페페로니 (피자용)\n", + "- 올리브 오일\n", + "- 소금\n", + "- 후추\n", + "\n", + "만드는 방법:\n", + "1. 오븐을 220도(섭씨 425도)로 예열합니다.\n", + "2. 피자 도우를 원형으로 펴서 피자 팬이나 바탕지에 올립니다.\n", + "3. 토마토 소스를 도우 위에 골고루 바른 후, 적당한 양의 모짜렐라 치즈를 뿌립니다.\n", + "4. 페페로니를 숟가락으로 적당량 떠서 치즈 위에 올립니다.\n", + "5. 소금과 후추를 적당히 뿌리고, 필요하다면 조금의 올리브 오일을 뿌립니다.\n", + "6. 예열된 오븐에 피자를 넣고 (피자 팬이나 바탕지를 이용) 12-15분 정도 굽습니다.\n", + "7. 피자가 바삭하고 치즈가 녹아 페페로니가 약간 황금색이 되면 꺼냅니다.\n", + "8. 피자를 오븐 미트로 조심스럽게 테이블에 내려놓고, 적당한 크기로 자릅니다.\n", + "9. 따뜻한 상태에서 팬치자를 즐겨주세요!" + ] + } + ], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import ModelInference\n", + "\n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "model = ModelInference(\n", + " model_id=\"ibm/granite-4-h-small\",\n", + " api_client=client,\n", + " project_id=f\"{project_id}\",\n", + " params = {\n", + " \"max_tokens\": 2000\n", + " }\n", + ")\n", + "# 사용자 프롬프트\n", + "user_prompt = '''페페로니 피자 만드는 방법 설명해줘.'''\n", + "\n", + "\n", + "system_prompt = '''\n", + "you ar a cooking assistant.\n", + "- Answer only question related to cooking, recipes, or ingredients.\n", + "- Provide clear and practical instructions.\n", + "- Use simple measurements and steps.\n", + "- Perfer bullet points over long paragraphs.\n", + "'''\n", + "messages = [\n", + " # 시스템 프롬프트\n", + " {\"role\" : \"system\", \"content\" : system_prompt},\n", + " {\"role\" : \"user\", \"content\" : user_prompt}, \n", + "]\n", + "\n", + "# generated_response = model.chat(messages = messages)\n", + "\n", + "# print(generated_response)\n", + "# print(generated_response['choices'][0]['message']['content'])\n", + "\n", + "generated_response_stream = model.chat_stream(messages=messages)\n", + "\n", + "for chunk in generated_response_stream:\n", + " if chunk['choices']:\n", + " print(chunk['choices'][0]['delta'].get('content', ''), end='', flush=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "e00b9f6c", + "metadata": {}, + "outputs": [ + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mKeyboardInterrupt\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[9]\u001b[39m\u001b[32m, line 34\u001b[39m\n\u001b[32m 30\u001b[39m {\u001b[33m\"role\"\u001b[39m : \u001b[33m\"system\"\u001b[39m, \u001b[33m\"content\"\u001b[39m : system_prompt},\n\u001b[32m 31\u001b[39m {\u001b[33m\"role\"\u001b[39m : \u001b[33m\"user\"\u001b[39m, \u001b[33m\"content\"\u001b[39m : user_prompt},\n\u001b[32m 32\u001b[39m ]\n\u001b[32m 33\u001b[39m \n\u001b[32m---> \u001b[39m\u001b[32m34\u001b[39m generated_response = model.chat(messages = messages)\n\u001b[32m 35\u001b[39m \n\u001b[32m 36\u001b[39m print(generated_response)\n\u001b[32m 37\u001b[39m print(generated_response[\u001b[33m'choices'\u001b[39m][\u001b[32m0\u001b[39m][\u001b[33m'message'\u001b[39m][\u001b[33m'content'\u001b[39m])\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/foundation_models/inference/model_inference.py:479\u001b[39m, in \u001b[36mModelInference.chat\u001b[39m\u001b[34m(self, messages, params, tools, tool_choice, tool_choice_option, context, crypto)\u001b[39m\n\u001b[32m 474\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m WMLClientError(\n\u001b[32m 475\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mThe `crypto` parameter is not supported for inferring a chat prompt deployment.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 476\u001b[39m )\n\u001b[32m 477\u001b[39m chat_fn = \u001b[38;5;28mself\u001b[39m._inference.chat\n\u001b[32m--> \u001b[39m\u001b[32m479\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mchat_fn\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 480\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mmessages\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mmessages\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 481\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 482\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtools\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtools\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 483\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtool_choice\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtool_choice\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 484\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtool_choice_option\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtool_choice_option\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 485\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mcontext\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mcontext\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 486\u001b[39m \u001b[30;43m\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/foundation_models/inference/fm_model_inference.py:135\u001b[39m, in \u001b[36mFMModelInference.chat\u001b[39m\u001b[34m(self, messages, params, tools, tool_choice, tool_choice_option, context, crypto)\u001b[39m\n\u001b[32m 123\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mchat\u001b[39m(\n\u001b[32m 124\u001b[39m \u001b[38;5;28mself\u001b[39m,\n\u001b[32m 125\u001b[39m messages: \u001b[38;5;28mlist\u001b[39m[\u001b[38;5;28mdict\u001b[39m],\n\u001b[32m (...)\u001b[39m\u001b[32m 131\u001b[39m crypto: \u001b[38;5;28mdict\u001b[39m | Crypto | \u001b[38;5;28;01mNone\u001b[39;00m = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m 132\u001b[39m ) -> \u001b[38;5;28mdict\u001b[39m:\n\u001b[32m 133\u001b[39m text_chat_url = \u001b[38;5;28mself\u001b[39m._client._href_definitions.get_fm_chat_href(\u001b[33m\"\u001b[39m\u001b[33mchat\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m--> \u001b[39m\u001b[32m135\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_send_chat_payload\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 136\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mmessages\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mmessages\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 137\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 138\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mgenerate_url\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtext_chat_url\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 139\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtools\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtools\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 140\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtool_choice\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtool_choice\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 141\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtool_choice_option\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtool_choice_option\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 142\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mcrypto\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mcrypto\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 143\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/foundation_models/inference/fm_model_inference.py:647\u001b[39m, in \u001b[36mFMModelInference._send_chat_payload\u001b[39m\u001b[34m(self, messages, params, generate_url, tools, tool_choice, tool_choice_option, crypto)\u001b[39m\n\u001b[32m 638\u001b[39m payload[\u001b[33m\"\u001b[39m\u001b[33mcrypto\u001b[39m\u001b[33m\"\u001b[39m] = crypto\n\u001b[32m 640\u001b[39m post_params: \u001b[38;5;28mdict\u001b[39m[\u001b[38;5;28mstr\u001b[39m, Any] = {\n\u001b[32m 641\u001b[39m \u001b[33m\"\u001b[39m\u001b[33murl\u001b[39m\u001b[33m\"\u001b[39m: generate_url,\n\u001b[32m 642\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mjson\u001b[39m\u001b[33m\"\u001b[39m: payload,\n\u001b[32m 643\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mparams\u001b[39m\u001b[33m\"\u001b[39m: \u001b[38;5;28mself\u001b[39m._client._params(skip_for_create=\u001b[38;5;28;01mTrue\u001b[39;00m, skip_userfs=\u001b[38;5;28;01mTrue\u001b[39;00m),\n\u001b[32m 644\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mheaders\u001b[39m\u001b[33m\"\u001b[39m: \u001b[38;5;28mself\u001b[39m._client._get_headers(),\n\u001b[32m 645\u001b[39m }\n\u001b[32m--> \u001b[39m\u001b[32m647\u001b[39m response_scoring = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_post\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_client\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mhttpx_client\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43mpost_params\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 649\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._handle_response(\n\u001b[32m 650\u001b[39m \u001b[32m200\u001b[39m,\n\u001b[32m 651\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mchat\u001b[39m\u001b[33m\"\u001b[39m,\n\u001b[32m 652\u001b[39m response_scoring,\n\u001b[32m 653\u001b[39m _field_to_hide=\u001b[33m\"\u001b[39m\u001b[33mchoices\u001b[39m\u001b[33m\"\u001b[39m,\n\u001b[32m 654\u001b[39m )\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/_wrappers/httpx_wrapper.py:498\u001b[39m, in \u001b[36m_with_retry..decorator..wrapper\u001b[39m\u001b[34m(self, *args, **kwargs)\u001b[39m\n\u001b[32m 496\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 497\u001b[39m response.close()\n\u001b[32m--> \u001b[39m\u001b[32m498\u001b[39m response = \u001b[30;43mfunction\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mself\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43margs\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43mkwargs\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 500\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[32m 501\u001b[39m response \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 502\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m (response.status_code \u001b[38;5;129;01min\u001b[39;00m wx_retry_status_codes)\n\u001b[32m 503\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m attempt != wx_max_retries\n\u001b[32m 504\u001b[39m ):\n\u001b[32m 505\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._client.CLOUD_PLATFORM_SPACES:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/foundation_models/inference/base_model_inference.py:651\u001b[39m, in \u001b[36mBaseModelInference._post\u001b[39m\u001b[34m(self, http_client, *args, **kwargs)\u001b[39m\n\u001b[32m 649\u001b[39m \u001b[38;5;129m@httpx_wrapper\u001b[39m._with_retry()\n\u001b[32m 650\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_post\u001b[39m(\u001b[38;5;28mself\u001b[39m, http_client: Any, *args: Any, **kwargs: Any) -> httpx.Response:\n\u001b[32m--> \u001b[39m\u001b[32m651\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mhttp_client\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mpost\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43margs\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43mkwargs\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/_wrappers/httpx_wrapper.py:294\u001b[39m, in \u001b[36mHTTPXClient.post\u001b[39m\u001b[34m(self, url, content, json, headers, params, **kwargs)\u001b[39m\n\u001b[32m 291\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m headers \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m headers.get(\u001b[33m\"\u001b[39m\u001b[33mContent-Type\u001b[39m\u001b[33m\"\u001b[39m) \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 292\u001b[39m headers[\u001b[33m\"\u001b[39m\u001b[33mContent-Type\u001b[39m\u001b[33m\"\u001b[39m] = \u001b[33m\"\u001b[39m\u001b[33mapplication/json\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m--> \u001b[39m\u001b[32m294\u001b[39m response = \u001b[30;43msuper\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43m)\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mpost\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 295\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43murl\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43murl\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 296\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mcontent\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mcontent\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 297\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mheaders\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mheaders\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 298\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 299\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43mkwargs\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 300\u001b[39m \u001b[30;43m\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 301\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m response\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_client.py:1144\u001b[39m, in \u001b[36mClient.post\u001b[39m\u001b[34m(self, url, content, data, files, json, params, headers, cookies, auth, follow_redirects, timeout, extensions)\u001b[39m\n\u001b[32m 1123\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mpost\u001b[39m(\n\u001b[32m 1124\u001b[39m \u001b[38;5;28mself\u001b[39m,\n\u001b[32m 1125\u001b[39m url: URL | \u001b[38;5;28mstr\u001b[39m,\n\u001b[32m (...)\u001b[39m\u001b[32m 1137\u001b[39m extensions: RequestExtensions | \u001b[38;5;28;01mNone\u001b[39;00m = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m 1138\u001b[39m ) -> Response:\n\u001b[32m 1139\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m 1140\u001b[39m \u001b[33;03m Send a `POST` request.\u001b[39;00m\n\u001b[32m 1141\u001b[39m \n\u001b[32m 1142\u001b[39m \u001b[33;03m **Parameters**: See `httpx.request`.\u001b[39;00m\n\u001b[32m 1143\u001b[39m \u001b[33;03m \"\"\"\u001b[39;00m\n\u001b[32m-> \u001b[39m\u001b[32m1144\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 1145\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m\"\u001b[39;49m\u001b[30;43mPOST\u001b[39;49m\u001b[30;43m\"\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1146\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43murl\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1147\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mcontent\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mcontent\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1148\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mdata\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mdata\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1149\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mfiles\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mfiles\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1150\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mjson\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mjson\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1151\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mparams\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1152\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mheaders\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mheaders\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1153\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mcookies\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mcookies\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1154\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mauth\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mauth\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1155\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1156\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mtimeout\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtimeout\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1157\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mextensions\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mextensions\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 1158\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_client.py:825\u001b[39m, in \u001b[36mClient.request\u001b[39m\u001b[34m(self, method, url, content, data, files, json, params, headers, cookies, auth, follow_redirects, timeout, extensions)\u001b[39m\n\u001b[32m 810\u001b[39m warnings.warn(message, \u001b[38;5;167;01mDeprecationWarning\u001b[39;00m, stacklevel=\u001b[32m2\u001b[39m)\n\u001b[32m 812\u001b[39m request = \u001b[38;5;28mself\u001b[39m.build_request(\n\u001b[32m 813\u001b[39m method=method,\n\u001b[32m 814\u001b[39m url=url,\n\u001b[32m (...)\u001b[39m\u001b[32m 823\u001b[39m extensions=extensions,\n\u001b[32m 824\u001b[39m )\n\u001b[32m--> \u001b[39m\u001b[32m825\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43msend\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43mauth\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mauth\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_client.py:914\u001b[39m, in \u001b[36mClient.send\u001b[39m\u001b[34m(self, request, stream, auth, follow_redirects)\u001b[39m\n\u001b[32m 910\u001b[39m \u001b[38;5;28mself\u001b[39m._set_timeout(request)\n\u001b[32m 912\u001b[39m auth = \u001b[38;5;28mself\u001b[39m._build_request_auth(request, auth)\n\u001b[32m--> \u001b[39m\u001b[32m914\u001b[39m response = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_send_handling_auth\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 915\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 916\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mauth\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mauth\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 917\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 918\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mhistory\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43m[\u001b[39;49m\u001b[30;43m]\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 919\u001b[39m \u001b[30;43m\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 920\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 921\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m stream:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_client.py:942\u001b[39m, in \u001b[36mClient._send_handling_auth\u001b[39m\u001b[34m(self, request, auth, follow_redirects, history)\u001b[39m\n\u001b[32m 939\u001b[39m request = \u001b[38;5;28mnext\u001b[39m(auth_flow)\n\u001b[32m 941\u001b[39m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m942\u001b[39m response = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_send_handling_redirects\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 943\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 944\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mfollow_redirects\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 945\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mhistory\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mhistory\u001b[39;49m\u001b[30;43m,\u001b[39;49m\n\u001b[32m 946\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 947\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 948\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_client.py:979\u001b[39m, in \u001b[36mClient._send_handling_redirects\u001b[39m\u001b[34m(self, request, follow_redirects, history)\u001b[39m\n\u001b[32m 976\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m hook \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m._event_hooks[\u001b[33m\"\u001b[39m\u001b[33mrequest\u001b[39m\u001b[33m\"\u001b[39m]:\n\u001b[32m 977\u001b[39m hook(request)\n\u001b[32m--> \u001b[39m\u001b[32m979\u001b[39m response = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_send_single_request\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 980\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 981\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m hook \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m._event_hooks[\u001b[33m\"\u001b[39m\u001b[33mresponse\u001b[39m\u001b[33m\"\u001b[39m]:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_client.py:1014\u001b[39m, in \u001b[36mClient._send_single_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 1009\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[32m 1010\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mAttempted to send an async request with a sync Client instance.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 1011\u001b[39m )\n\u001b[32m 1013\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m request_context(request=request):\n\u001b[32m-> \u001b[39m\u001b[32m1014\u001b[39m response = \u001b[30;43mtransport\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mhandle_request\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 1016\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(response.stream, SyncByteStream)\n\u001b[32m 1018\u001b[39m response.request = request\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/ibm_watsonx_ai/_wrappers/httpx_wrapper.py:815\u001b[39m, in \u001b[36mRetryTransport.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 812\u001b[39m response.close()\n\u001b[32m 814\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m815\u001b[39m response = \u001b[30;43msuper\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43m)\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mhandle_request\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 817\u001b[39m \u001b[38;5;66;03m# super().handle_request may return None in cases when certificate\u001b[39;00m\n\u001b[32m 818\u001b[39m \u001b[38;5;66;03m# verification fails. The reason for this behavior is unknown,\u001b[39;00m\n\u001b[32m 819\u001b[39m \u001b[38;5;66;03m# but retrying with certificate validation turned off fixes this.\u001b[39;00m\n\u001b[32m 820\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpx/_transports/default.py:250\u001b[39m, in \u001b[36mHTTPTransport.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 237\u001b[39m req = httpcore.Request(\n\u001b[32m 238\u001b[39m method=request.method,\n\u001b[32m 239\u001b[39m url=httpcore.URL(\n\u001b[32m (...)\u001b[39m\u001b[32m 247\u001b[39m extensions=request.extensions,\n\u001b[32m 248\u001b[39m )\n\u001b[32m 249\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m map_httpcore_exceptions():\n\u001b[32m--> \u001b[39m\u001b[32m250\u001b[39m resp = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_pool\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mhandle_request\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mreq\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 252\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(resp.stream, typing.Iterable)\n\u001b[32m 254\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m Response(\n\u001b[32m 255\u001b[39m status_code=resp.status,\n\u001b[32m 256\u001b[39m headers=resp.headers,\n\u001b[32m 257\u001b[39m stream=ResponseStream(resp.stream),\n\u001b[32m 258\u001b[39m extensions=resp.extensions,\n\u001b[32m 259\u001b[39m )\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py:256\u001b[39m, in \u001b[36mConnectionPool.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 253\u001b[39m closing = \u001b[38;5;28mself\u001b[39m._assign_requests_to_connections()\n\u001b[32m 255\u001b[39m \u001b[38;5;28mself\u001b[39m._close_connections(closing)\n\u001b[32m--> \u001b[39m\u001b[32m256\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m exc \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 258\u001b[39m \u001b[38;5;66;03m# Return the response. Note that in this case we still have to manage\u001b[39;00m\n\u001b[32m 259\u001b[39m \u001b[38;5;66;03m# the point at which the response is closed.\u001b[39;00m\n\u001b[32m 260\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(response.stream, typing.Iterable)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py:236\u001b[39m, in \u001b[36mConnectionPool.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 232\u001b[39m connection = pool_request.wait_for_connection(timeout=timeout)\n\u001b[32m 234\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 235\u001b[39m \u001b[38;5;66;03m# Send the request on the assigned connection.\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m236\u001b[39m response = \u001b[30;43mconnection\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mhandle_request\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 237\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mpool_request\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\n\u001b[32m 238\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 239\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m ConnectionNotAvailable:\n\u001b[32m 240\u001b[39m \u001b[38;5;66;03m# In some cases a connection may initially be available to\u001b[39;00m\n\u001b[32m 241\u001b[39m \u001b[38;5;66;03m# handle a request, but then become unavailable.\u001b[39;00m\n\u001b[32m 242\u001b[39m \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[32m 243\u001b[39m \u001b[38;5;66;03m# In this case we clear the connection and try again.\u001b[39;00m\n\u001b[32m 244\u001b[39m pool_request.clear_connection()\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py:103\u001b[39m, in \u001b[36mHTTPConnection.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 100\u001b[39m \u001b[38;5;28mself\u001b[39m._connect_failed = \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[32m 101\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[32m--> \u001b[39m\u001b[32m103\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_connection\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mhandle_request\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mrequest\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py:136\u001b[39m, in \u001b[36mHTTP11Connection.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 134\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m Trace(\u001b[33m\"\u001b[39m\u001b[33mresponse_closed\u001b[39m\u001b[33m\"\u001b[39m, logger, request) \u001b[38;5;28;01mas\u001b[39;00m trace:\n\u001b[32m 135\u001b[39m \u001b[38;5;28mself\u001b[39m._response_closed()\n\u001b[32m--> \u001b[39m\u001b[32m136\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m exc\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py:106\u001b[39m, in \u001b[36mHTTP11Connection.handle_request\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 95\u001b[39m \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[32m 97\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m Trace(\n\u001b[32m 98\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mreceive_response_headers\u001b[39m\u001b[33m\"\u001b[39m, logger, request, kwargs\n\u001b[32m 99\u001b[39m ) \u001b[38;5;28;01mas\u001b[39;00m trace:\n\u001b[32m 100\u001b[39m (\n\u001b[32m 101\u001b[39m http_version,\n\u001b[32m 102\u001b[39m status,\n\u001b[32m 103\u001b[39m reason_phrase,\n\u001b[32m 104\u001b[39m headers,\n\u001b[32m 105\u001b[39m trailing_data,\n\u001b[32m--> \u001b[39m\u001b[32m106\u001b[39m ) = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_receive_response_headers\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43m*\u001b[39;49m\u001b[30;43mkwargs\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 107\u001b[39m trace.return_value = (\n\u001b[32m 108\u001b[39m http_version,\n\u001b[32m 109\u001b[39m status,\n\u001b[32m 110\u001b[39m reason_phrase,\n\u001b[32m 111\u001b[39m headers,\n\u001b[32m 112\u001b[39m )\n\u001b[32m 114\u001b[39m network_stream = \u001b[38;5;28mself\u001b[39m._network_stream\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py:177\u001b[39m, in \u001b[36mHTTP11Connection._receive_response_headers\u001b[39m\u001b[34m(self, request)\u001b[39m\n\u001b[32m 174\u001b[39m timeout = timeouts.get(\u001b[33m\"\u001b[39m\u001b[33mread\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m 176\u001b[39m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m177\u001b[39m event = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_receive_event\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mtimeout\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtimeout\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 178\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(event, h11.Response):\n\u001b[32m 179\u001b[39m \u001b[38;5;28;01mbreak\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py:217\u001b[39m, in \u001b[36mHTTP11Connection._receive_event\u001b[39m\u001b[34m(self, timeout)\u001b[39m\n\u001b[32m 214\u001b[39m event = \u001b[38;5;28mself\u001b[39m._h11_state.next_event()\n\u001b[32m 216\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m event \u001b[38;5;129;01mis\u001b[39;00m h11.NEED_DATA:\n\u001b[32m--> \u001b[39m\u001b[32m217\u001b[39m data = \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_network_stream\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mread\u001b[39;49m\u001b[30;43m(\u001b[39;49m\n\u001b[32m 218\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mREAD_NUM_BYTES\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43mtimeout\u001b[39;49m\u001b[30;43m=\u001b[39;49m\u001b[30;43mtimeout\u001b[39;49m\n\u001b[32m 219\u001b[39m \u001b[30;43m \u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 221\u001b[39m \u001b[38;5;66;03m# If we feed this case through h11 we'll raise an exception like:\u001b[39;00m\n\u001b[32m 222\u001b[39m \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[32m 223\u001b[39m \u001b[38;5;66;03m# httpcore.RemoteProtocolError: can't handle event type\u001b[39;00m\n\u001b[32m (...)\u001b[39m\u001b[32m 227\u001b[39m \u001b[38;5;66;03m# perspective. Instead we handle this case distinctly and treat\u001b[39;00m\n\u001b[32m 228\u001b[39m \u001b[38;5;66;03m# it as a ConnectError.\u001b[39;00m\n\u001b[32m 229\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m data == \u001b[33mb\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m._h11_state.their_state == h11.SEND_RESPONSE:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/Documents/Source/WATSONX/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py:128\u001b[39m, in \u001b[36mSyncStream.read\u001b[39m\u001b[34m(self, max_bytes, timeout)\u001b[39m\n\u001b[32m 126\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m map_exceptions(exc_map):\n\u001b[32m 127\u001b[39m \u001b[38;5;28mself\u001b[39m._sock.settimeout(timeout)\n\u001b[32m--> \u001b[39m\u001b[32m128\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_sock\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mrecv\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mmax_bytes\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/.pyenv/versions/3.12.10/lib/python3.12/ssl.py:1232\u001b[39m, in \u001b[36mSSLSocket.recv\u001b[39m\u001b[34m(self, buflen, flags)\u001b[39m\n\u001b[32m 1228\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m flags != \u001b[32m0\u001b[39m:\n\u001b[32m 1229\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[32m 1230\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mnon-zero flags not allowed in calls to recv() on \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m %\n\u001b[32m 1231\u001b[39m \u001b[38;5;28mself\u001b[39m.\u001b[34m__class__\u001b[39m)\n\u001b[32m-> \u001b[39m\u001b[32m1232\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mread\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mbuflen\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 1233\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1234\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m().recv(buflen, flags)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~/.pyenv/versions/3.12.10/lib/python3.12/ssl.py:1105\u001b[39m, in \u001b[36mSSLSocket.read\u001b[39m\u001b[34m(self, len, buffer)\u001b[39m\n\u001b[32m 1103\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._sslobj.read(\u001b[38;5;28mlen\u001b[39m, buffer)\n\u001b[32m 1104\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1105\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[30;43mself\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43m_sslobj\u001b[39;49m\u001b[30;43m.\u001b[39;49m\u001b[30;43mread\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43mlen\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 1106\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m SSLError \u001b[38;5;28;01mas\u001b[39;00m x:\n\u001b[32m 1107\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m x.args[\u001b[32m0\u001b[39m] == SSL_ERROR_EOF \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m.suppress_ragged_eofs:\n", + "\u001b[31mKeyboardInterrupt\u001b[39m: " + ] + } + ], + "source": [ + "from ibm_watsonx_ai import APIClient\n", + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import ModelInference\n", + "\n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "model = ModelInference(\n", + " model_id=\"ibm/granite-4-h-small\",\n", + " api_client=client,\n", + " project_id=f\"{project_id}\",\n", + " params = {\n", + " \"max_tokens\": 2000,\n", + " \"temperature\" : 1.5\n", + " }\n", + ")\n", + "# 사용자 프롬프트\n", + "user_prompt = '''무서운 이야기 만들어'''\n", + "\n", + "\n", + "system_prompt = '''\n", + "너는 유명한 공포 라디오 dj임\n", + "'''\n", + "\n", + "messages = [\n", + " # 시스템 프롬프트\n", + " {\"role\" : \"system\", \"content\" : system_prompt},\n", + " {\"role\" : \"user\", \"content\" : user_prompt}, \n", + "]\n", + "\n", + "generated_response = model.chat(messages = messages)\n", + "\n", + "print(generated_response)\n", + "print(generated_response['choices'][0]['message']['content'])\n" + ] + }, + { + "cell_type": "markdown", + "id": "00017b77", + "metadata": {}, + "source": [ + "### 토큰\n", + "- " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "45152888", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'completion_tokens': 769, 'prompt_tokens': 43, 'total_tokens': 812}\n", + "0.307714502\n" + ] + } + ], + "source": [ + "print(generated_response['usage'])\n", + "\n", + "# completion_tokens : 모델이 생선한 응답에 사용된 토큰 수\n", + "# prompt_tokens : 모델이 입력으로 받은 내용에 사용된 토큰 수\n", + "\n", + "total = 0.0000636 / 1000 * generated_response['usage']['prompt_tokens'] + 0.000265 / 1000 * generated_response['usage']['completion_tokens']\n", + "\n", + "print(total * 1490)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "a3e4d2c8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "이미지 분석을 위해 요청하신 이미지를 분석해 보겠습니다.\n", + "\n", + "### 이미지 설명\n", + "\n", + "이미지는 가로세로 비율이 1:1인 직사각형 모양의 사진으로, 배경은 하얀색입니다. 사진 속에는 1마리의 흑백고양이와 노란색 배경이 있습니다. 사진 속 고양이는 앞발을 꼬리를 감싸고 있고, 눈을 감고 있습니다. 고양이의 앞발은 노란색 배경과 거의 일치합니다. 고양이의 앞발과 꼬리 사이에는 검은색 배경이 있습니다. 배경의 색깔은 노란색, 검은색, 하얀색입니다. 이 이미지는 동물의 사진입니다.\n", + "\n", + "### 분위기 분석\n", + "\n", + "이미지는 평온하고 여유로운 분위기를 보여줍니다. 사진 속 고양이가 눈을 감고 있는 모습으로 보아, 이 이미지는 고양이가 행복하고 편안함을 느끼고 있는 모습을 보여줍니다. 이 이미지는 평온한 분위기를 연출하고 있습니다.\n", + "\n", + "### 감정 분석\n", + "\n", + "이미지 속 고양이의 감정은 평온하고 여유로우며, 행복함을 느끼고 있는 것으로 보입니다. 고양이가 눈을 감고 있는 모습으로 보아, 이 이미지는 고양이가 편안함을 느끼고 있는 모습을 보여줍니다. 이 이미지는 고양이의 감정에 대한 감정을 연출하고 있습니다.\n", + "\n", + "### 객체 설명\n", + "\n", + "이미지 속 객체는 다음과 같습니다.\n", + "\n", + "* 흑백고양이 1마리\n", + "* 노란색 배경\n", + "* 검은색 배경\n", + "\n", + "이미지 속 객체는 흑백고양이 1마리와 배경이 있습니다.\n", + "\n", + "### 캡션 생성\n", + "\n", + "이미지 캡션은 다음과 같습니다.\n", + "\n", + "\"침잠 중인 고양이\"\n", + "\n", + "이미지 캡션은 사진 속 고양이가 눈을 감고 있는 모습을 보여줍니다.\n", + "\n", + "### 여행 추천\n", + "\n", + "이미지 속 고양이가 침잠 중인 모습으로 보아, 이 이미지는 여행을 계획하거나 여행을 하기에는 적합하지 않습니다. 이 이미지는 평온하고 여유로운 분위기를 연출하고 있기 때문에, 여행을 계획하거나 여행을 하기에는 적합하지 않습니다. \n", + "\n", + "### 줄 좀 나눠서 써줘라\n", + "\n", + "이미지 분석을 위해 요청하신 이미지를 분석해 보았습니다. 이미지 속 고양이의 감정은 평온하고 여유로우며, 행복함을 느끼고 있는 것으로 보입니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이미지 캡션은 \"침잠 중인 고양이\"입니다. 이미지 속 객체는 흑백고양이 1마리와 배경이 있습니다. 이미지 속 배경은 노란색과 검은색입니다. 이미지 속 배경은 하얀색입니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미지는 평온한 분위기를 연출하고 있습니다. 이 이미\n" + ] + } + ], + "source": [ + "import base64\n", + "\n", + "filename = './image/gorong.png'\n", + "\n", + "with open(filename, 'rb') as image_file:\n", + " image_b64_encoded_string = base64.b64encode(image_file.read()).decode('utf-8')\n", + " \n", + "credentials = Credentials(\n", + " url = f\"{watsonx_ai_url}\",\n", + " api_key = f\"{apikey}\",\n", + ")\n", + "client = APIClient(credentials)\n", + "\n", + "model = ModelInference(\n", + " model_id=\"meta-llama/llama-3-2-11b-vision-instruct\",\n", + " api_client=client,\n", + " project_id=f\"{project_id}\",\n", + " params = {\n", + " \"max_tokens\": 1000\n", + " }\n", + ")\n", + "\n", + "# system prompt\n", + "system_prompt = \"\"\"\n", + "당신은 이미지 분석 전문가입니다.\n", + "사용자의 요청에 따라 이미지를 분석하세요.\n", + "- 이미지 설명\n", + "- 분위기 분석\n", + "- 감정 분석\n", + "- 객체 설명\n", + "- 캡션 생성\n", + "- 여행 추천\n", + "- 줄 좀 나눠서 써줘라\n", + "\"\"\"\n", + "\n", + "# user prompt\n", + "user_prompt = \"\"\"\n", + "이미지를 분석해줘\n", + "\"\"\"\n", + "\n", + "messages = [\n", + " # system prompt\n", + " {\"role\" : \"system\", \"content\" : system_prompt },\n", + " {\"role\" : \"user\", \"content\":[\n", + " {\n", + " \"type\": \"image_url\",\n", + " \"image_url\": {\n", + " \"url\": f\"data:image/png;base64,{image_b64_encoded_string}\"\n", + " }\n", + " },\n", + " {\n", + " \"type\": \"text\",\n", + " \"text\": user_prompt\n", + " }\n", + " ]\n", + " },\n", + "]\n", + "generated_response = model.chat(messages=messages)\n", + "print(generated_response['choices'][0]['message']['content'])" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "4ec575aa", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\n", + " [\n", + " -0.04806165769696236,\n", + " 0.053440578281879425,\n", + " -0.06285369396209717,\n", + " -0.009880032390356064,\n", + " 0.012961706146597862,\n", + " -0.03670615702867508,\n", + " 0.05792301520705223,\n", + " -0.009487819857895374,\n", + " 0.03087899275124073,\n", + " 0.017693165689706802,\n", + " 0.003810069290921092,\n", + " 0.03879795968532562,\n", + " -0.01536478940397501,\n", + " 0.00786916259676218,\n", + " 0.013322791084647179,\n", + " 0.04340490698814392,\n", + " 0.019473686814308167,\n", + " -0.026471266523003578,\n", + " -0.017842579632997513,\n", + " 0.036631450057029724,\n", + " -0.023632390424609184,\n", + " -0.009774197824299335,\n", + " -0.06499529629945755,\n", + " 0.013584266416728497,\n", + " 0.0055189975537359715,\n", + " -0.05279311537742615,\n", + " -0.01743168942630291,\n", + " 0.01590019091963768,\n", + " -0.026944411918520927,\n", + " 0.04367883503437042,\n", + " -0.0024388800375163555,\n", + " 0.06026384234428406,\n", + " -0.0311778225004673,\n", + " 0.026869704946875572,\n", + " 0.010459013283252716,\n", + " 0.05578140541911125,\n", + " -0.007626364007592201,\n", + " 0.042707640677690506,\n", + " 0.009108058176934719,\n", + " -0.04156212881207466,\n", + " 0.03832481428980827,\n", + " 0.07271505147218704,\n", + " -0.029882896691560745,\n", + " 0.0687306597828865,\n", + " -0.04562122002243996,\n", + " 0.008124412037432194,\n", + " -0.04587024450302124,\n", + " 0.010185087099671364,\n", + " 0.021129697561264038,\n", + " -0.032622162252664566,\n", + " -0.019946834072470665,\n", + " 0.0550343357026577,\n", + " 0.03650693967938423,\n", + " 0.04056603088974953,\n", + " -0.017332080751657486,\n", + " 0.014418497681617737,\n", + " -0.012644200585782528,\n", + " 0.054337065666913986,\n", + " -0.026371655985713005,\n", + " 0.033394135534763336,\n", + " -0.0662902221083641,\n", + " -0.019946834072470665,\n", + " 0.03160116448998451,\n", + " 0.0028668902814388275,\n", + " 0.011616976000368595,\n", + " 0.009761746041476727,\n", + " 0.04156212881207466,\n", + " -0.026247143745422363,\n", + " 0.018876029178500175,\n", + " -0.08402074128389359,\n", + " 0.0047314586117863655,\n", + " -0.0024622261989861727,\n", + " 0.06469646841287613,\n", + " 0.0676349550485611,\n", + " -0.04076525196433067,\n", + " -0.0050147236324846745,\n", + " -0.013335242867469788,\n", + " 0.05712613835930824,\n", + " -0.04352941736578941,\n", + " 0.04519788175821304,\n", + " -0.007066059857606888,\n", + " 0.01017886120826006,\n", + " -0.007844259962439537,\n", + " 0.01773051917552948,\n", + " 0.0370049849152565,\n", + " 0.09039576351642609,\n", + " -0.017929738387465477,\n", + " -0.024105535820126534,\n", + " 0.002574287122115493,\n", + " 0.010739166289567947,\n", + " 0.02843855693936348,\n", + " -0.04061583802103996,\n", + " 0.003333810716867447,\n", + " 0.04223449528217316,\n", + " 0.07012519985437393,\n", + " -0.03658164665102959,\n", + " -0.013808388262987137,\n", + " 0.008080833591520786,\n", + " 0.02644636295735836,\n", + " 0.005011610686779022,\n", + " 0.04806165769696236,\n", + " 0.006785907782614231,\n", + " 0.04723987728357315,\n", + " 0.005378921516239643,\n", + " 0.00561860715970397,\n", + " -0.012264438904821873,\n", + " 0.06947773694992065,\n", + " -0.02414288930594921,\n", + " -0.013459754176437855,\n", + " 0.0068170358426868916,\n", + " 0.036905378103256226,\n", + " -0.038424424827098846,\n", + " -0.0008894830825738609,\n", + " -0.005715103819966316,\n", + " -0.010645781643688679,\n", + " 0.03197469934821129,\n", + " 0.04843519628047943,\n", + " -0.0721173882484436,\n", + " -0.03810069337487221,\n", + " 0.014729777351021767,\n", + " 0.055582188069820404,\n", + " -0.0061166551895439625,\n", + " 0.031401943415403366,\n", + " -0.0687306597828865,\n", + " 0.023022281005978584,\n", + " 0.015651166439056396,\n", + " 0.044077273458242416,\n", + " 0.03444003686308861,\n", + " -0.001968847122043371,\n", + " 0.018390432000160217,\n", + " 0.006717426236718893,\n", + " 0.00948159396648407,\n", + " 0.008759424090385437,\n", + " 0.054038237780332565,\n", + " -0.029783286154270172,\n", + " 0.0021633971482515335,\n", + " -0.07580294460058212,\n", + " 0.023159245029091835,\n", + " 0.012936803512275219,\n", + " 0.02724323980510235,\n", + " 0.06225603446364403,\n", + " -0.02704402059316635,\n", + " 0.014256631955504417,\n", + " 0.011486237868666649,\n", + " -0.01971025951206684,\n", + " -0.031003504991531372,\n", + " -0.02386896312236786,\n", + " 0.03359335660934448,\n", + " 0.007209248840808868,\n", + " 0.04492395371198654,\n", + " 0.024267401546239853,\n", + " 0.025462718680500984,\n", + " 0.026545973494648933,\n", + " 0.05209584906697273,\n", + " -0.05627945438027382,\n", + " 0.050352681428194046,\n", + " 0.006004594266414642,\n", + " 0.014094766229391098,\n", + " 0.0021244871895760298,\n", + " 0.045347295701503754,\n", + " -0.03792637586593628,\n", + " -0.024989571422338486,\n", + " 0.032024502754211426,\n", + " 0.004694105125963688,\n", + " 0.01745659112930298,\n", + " 0.06225603446364403,\n", + " -0.002932259114459157,\n", + " 0.0040746573358774185,\n", + " -0.02200128324329853,\n", + " 0.04589514806866646,\n", + " 0.013360144570469856,\n", + " -0.0033867282327264547,\n", + " -0.013484656810760498,\n", + " 0.015489301644265652,\n", + " 0.008180443197488785,\n", + " -0.0034956762101501226,\n", + " 0.11524836719036102,\n", + " 0.07789474725723267,\n", + " -0.013248084113001823,\n", + " -0.0031143580563366413,\n", + " -0.0005089431069791317,\n", + " 0.0550343357026577,\n", + " -0.0755041167140007,\n", + " 0.03043074905872345,\n", + " 0.009363307617604733,\n", + " 0.02061919867992401,\n", + " 0.038150496780872345,\n", + " -0.04833558574318886,\n", + " 0.03899718075990677,\n", + " 0.006829487159848213,\n", + " 0.02230011112987995,\n", + " 0.03588437661528587,\n", + " 0.04574573412537575,\n", + " 0.015041057951748371,\n", + " 0.021017637103796005,\n", + " -0.040914665907621384,\n", + " -0.009525173343718052,\n", + " -0.010583525523543358,\n", + " 0.005687088705599308,\n", + " -0.04113878682255745,\n", + " 0.017643360421061516,\n", + " 0.026969313621520996,\n", + " 0.06210662052035332,\n", + " -0.018527396023273468,\n", + " 0.025624584406614304,\n", + " 0.0008404564578086138,\n", + " 0.003458322724327445,\n", + " 0.0008575768442824483,\n", + " 0.015800582244992256,\n", + " 0.023134341463446617,\n", + " 0.04420178383588791,\n", + " 0.032796479761600494,\n", + " -0.03189999237656593,\n", + " 0.07505587488412857,\n", + " -0.004740796983242035,\n", + " 0.050078753381967545,\n", + " 0.022225404158234596,\n", + " 0.027791094034910202,\n", + " 0.0006622485816478729,\n", + " 0.013198278844356537,\n", + " 0.030928798019886017,\n", + " -0.01252591423690319,\n", + " 0.07530489563941956,\n", + " -0.000511277699843049,\n", + " -0.013173377141356468,\n", + " -0.020706357434391975,\n", + " 0.011480012908577919,\n", + " 0.059417158365249634,\n", + " 0.05119936168193817,\n", + " -0.032472748309373856,\n", + " 0.06270428001880646,\n", + " 0.024391913786530495,\n", + " -0.02337091602385044,\n", + " -0.017020799219608307,\n", + " 0.03929600864648819,\n", + " -0.037677351385354996,\n", + " 0.017020799219608307,\n", + " 0.005973466672003269,\n", + " 0.00026264265761710703,\n", + " -0.011336823925375938,\n", + " -0.036905378103256226,\n", + " -0.03750303387641907,\n", + " -0.03486337885260582,\n", + " 0.003968822304159403,\n", + " 0.02447907254099846,\n", + " 0.03409140557050705,\n", + " -0.011803744360804558,\n", + " -0.0019439447205513716,\n", + " 0.04345471039414406,\n", + " -0.043180786073207855,\n", + " -0.009369533509016037,\n", + " 0.04313097894191742,\n", + " 0.06066228076815605,\n", + " 0.07600216567516327,\n", + " 0.055582188069820404,\n", + " -0.05224526301026344,\n", + " 0.02188922092318535,\n", + " 0.018838675692677498,\n", + " 0.04108898341655731,\n", + " 0.024728097021579742,\n", + " 0.05060170590877533,\n", + " 0.02325885370373726,\n", + " 0.025773998349905014,\n", + " 0.029384847730398178,\n", + " -0.023806707933545113,\n", + " 0.03351864963769913,\n", + " 0.038125596940517426,\n", + " -0.015601362101733685,\n", + " -0.015339886769652367,\n", + " 0.014966350980103016,\n", + " -0.010676910169422626,\n", + " -0.025114083662629128,\n", + " 0.013534462079405785,\n", + " 0.01773051917552948,\n", + " -0.007657492067664862,\n", + " 0.012662877328693867,\n", + " -0.04031700640916824,\n", + " 0.05837125703692436,\n", + " 0.005615494213998318,\n", + " -0.034315526485443115,\n", + " 0.02032036893069744,\n", + " -0.025114083662629128,\n", + " -0.028015214949846268,\n", + " 0.03473886847496033,\n", + " 0.02644636295735836,\n", + " 0.06599139422178268,\n", + " 0.054337065666913986,\n", + " -0.0172822754830122,\n", + " 0.03476376831531525,\n", + " -0.009120509028434753,\n", + " -0.010726714506745338,\n", + " 0.01740678772330284,\n", + " 0.053141750395298004,\n", + " -0.06658905744552612,\n", + " -0.005064528435468674,\n", + " -0.04186095669865608,\n", + " 0.05104994773864746,\n", + " -0.014418497681617737,\n", + " 0.057723794132471085,\n", + " -0.01039675809442997,\n", + " 0.018228566274046898,\n", + " -0.001208545290865004,\n", + " 0.011137604713439941,\n", + " -0.03747813403606415,\n", + " 0.011442659422755241,\n", + " 0.027492264285683632,\n", + " -0.06135954707860947,\n", + " 0.025873607024550438,\n", + " 0.02259894087910652,\n", + " -0.0670870989561081,\n", + " 0.04596985504031181,\n", + " 0.037204205989837646,\n", + " 0.039520129561424255,\n", + " -0.017469042912125587,\n", + " -0.05583121255040169,\n", + " -0.018900932744145393,\n", + " -0.03685557097196579,\n", + " -0.06942792981863022,\n", + " -0.007576559204608202,\n", + " 0.0056590735912323,\n", + " 0.014244180172681808,\n", + " -0.0027594987768679857,\n", + " 0.03349374607205391,\n", + " -0.016921190544962883,\n", + " 0.02320905029773712,\n", + " -0.024093085899949074,\n", + " -0.03304550424218178,\n", + " 0.02552497386932373,\n", + " 0.03175057843327522,\n", + " -0.0338921844959259,\n", + " -0.003900340525433421,\n", + " -0.05264370143413544,\n", + " 0.0015688521089032292,\n", + " 0.016298629343509674,\n", + " 0.032348234206438065,\n", + " -0.027168532833456993,\n", + " -0.03329452872276306,\n", + " 0.064796082675457,\n", + " -0.016734421253204346,\n", + " -0.025188790634274483,\n", + " -0.012862096540629864,\n", + " 0.00031886762008070946,\n", + " 0.04709046334028244,\n", + " 0.09169068932533264,\n", + " 0.062305837869644165,\n", + " 0.051747214049100876,\n", + " -0.0618077889084816,\n", + " 0.024105535820126534,\n", + " 0.019050346687436104,\n", + " 0.004887098912149668,\n", + " 0.029758384451270103,\n", + " -0.009139185771346092,\n", + " 0.020258113741874695,\n", + " 0.0154519472271204,\n", + " 0.016933640465140343,\n", + " -0.02963387221097946,\n", + " 0.04880873113870621,\n", + " -0.04061583802103996,\n", + " 0.016771774739027023,\n", + " -0.0017509509343653917,\n", + " 0.0037789412308484316,\n", + " -0.020569393411278725,\n", + " 0.0015626264503225684,\n", + " 0.0540880411863327,\n", + " 0.011959384195506573,\n", + " 0.07405977696180344,\n", + " 0.03025643341243267,\n", + " -0.035535745322704315,\n", + " 0.008167991414666176,\n", + " 0.01575077697634697,\n", + " 0.008690942078828812,\n", + " 0.038001082837581635,\n", + " -0.05047719180583954,\n", + " -0.003340036142617464,\n", + " -0.052195459604263306,\n", + " 0.0044481935910880566,\n", + " 0.0037913925480097532,\n", + " 0.06280388683080673,\n", + " 0.027766190469264984,\n", + " -0.026047924533486366,\n", + " -0.0006066072382964194,\n", + " 0.038275010883808136,\n", + " 0.023022281005978584,\n", + " -0.0773966982960701,\n", + " -0.05224526301026344,\n", + " -0.010639556683599949,\n", + " 0.007458272855728865,\n", + " -0.04973011836409569,\n", + " -0.004105785395950079,\n", + " -0.015974897891283035,\n", + " 0.017792774364352226,\n", + " 0.032821379601955414,\n", + " 0.012444981373846531,\n", + " 0.029932701960206032,\n", + " 0.007420919369906187,\n", + " 0.01816631108522415,\n", + " 0.021939026191830635,\n", + " -0.007570333778858185,\n", + " 0.04918226599693298,\n", + " -0.01665971428155899,\n", + " 0.04138781130313873,\n", + " -0.013310340233147144,\n", + " 0.024578683078289032,\n", + " 0.0525938980281353,\n", + " 0.0044264039024710655,\n", + " -0.06011442840099335,\n", + " 0.04355432093143463,\n", + " 0.042832151055336,\n", + " -0.04452551528811455,\n", + " 0.07017499953508377,\n", + " 0.08113206177949905,\n", + " 0.007601461838930845,\n", + " 0.006325213238596916,\n", + " -0.06907929480075836,\n", + " -0.004093334078788757,\n", + " 0.01710795797407627,\n", + " -0.026172436773777008,\n", + " 0.04773792624473572,\n", + " 0.025923412293195724,\n", + " 0.05289272591471672,\n", + " -0.005531448405236006,\n", + " 0.045496709644794464,\n", + " -0.0044637578539550304,\n", + " 0.03807578980922699,\n", + " -0.02629694901406765,\n", + " 0.023632390424609184,\n", + " 0.034938085824251175,\n", + " 0.0550343357026577,\n", + " 0.059715986251831055,\n", + " 0.036482036113739014,\n", + " -0.04138781130313873,\n", + " 0.03715440258383751,\n", + " 0.017083056271076202,\n", + " 0.024653390049934387,\n", + " 0.01786748133599758,\n", + " 0.016012251377105713,\n", + " -0.0077820043079555035,\n", + " 0.032771576195955276,\n", + " 0.0623556450009346,\n", + " 0.004837293643504381,\n", + " 0.04801185429096222,\n", + " -0.004949354566633701,\n", + " 0.055582188069820404,\n", + " 0.007862936705350876,\n", + " 0.030231529846787453,\n", + " -0.014792033471167088,\n", + " 0.02276080660521984,\n", + " -0.01191580481827259,\n", + " 0.03680576756596565,\n", + " 0.034788671880960464,\n", + " 0.03516220673918724,\n", + " -0.0348384752869606,\n", + " -0.004700330551713705,\n", + " -0.0258238036185503,\n", + " 0.02231256291270256,\n", + " 0.015090862289071083,\n", + " 0.09223853796720505,\n", + " 0.02384406141936779,\n", + " 0.03254745528101921,\n", + " -0.04375354200601578,\n", + " 0.012345371767878532,\n", + " 0.0038536484353244305,\n", + " -0.010390532203018665,\n", + " -0.00013316955300979316,\n", + " -0.004267651122063398,\n", + " -0.00661159073933959,\n", + " 0.052942533046007156,\n", + " -0.04644300043582916,\n", + " 0.07918967306613922,\n", + " 0.07052363455295563,\n", + " 0.003305795369669795,\n", + " -0.02188922092318535,\n", + " 0.02109234407544136,\n", + " 0.03331942856311798,\n", + " 0.04537219926714897,\n", + " 0.016622360795736313,\n", + " 0.051597800105810165,\n", + " -0.02171490527689457,\n", + " -0.03194979578256607,\n", + " -0.075902558863163,\n", + " -0.008697167970240116,\n", + " 0.037826765328645706,\n", + " 0.01867680996656418,\n", + " -0.04345471039414406,\n", + " 0.057424966245889664,\n", + " 0.015987349674105644,\n", + " 0.05334097146987915,\n", + " 0.043927859514951706,\n", + " 0.04788734018802643,\n", + " 0.0038007309194654226,\n", + " -0.021515686064958572,\n", + " -0.03242294117808342,\n", + " 0.04681653901934624,\n", + " 0.06773456186056137,\n", + " -0.022661196067929268,\n", + " -0.00011488184100016952,\n", + " 0.0204697847366333,\n", + " -0.10190067440271378,\n", + " -0.027591874822974205,\n", + " -0.02704402059316635,\n", + " -0.01957329735159874,\n", + " 0.04081505537033081,\n", + " -0.00923879537731409,\n", + " -0.005369583144783974,\n", + " 0.08934985846281052,\n", + " -0.06101091206073761,\n", + " 0.02432965859770775,\n", + " 0.035087499767541885,\n", + " 0.032647065818309784,\n", + " -0.006094865966588259,\n", + " -0.040889762341976166,\n", + " -0.03055526129901409,\n", + " 0.01603715494275093,\n", + " -0.034614354372024536,\n", + " 0.002214758424088359,\n", + " 0.02354523167014122,\n", + " -0.0035081275273114443,\n", + " -0.03160116448998451,\n", + " -0.017157763242721558,\n", + " 0.05966618284583092,\n", + " 0.011044220067560673,\n", + " -0.021739806979894638,\n", + " -0.03491318225860596,\n", + " -0.04061583802103996,\n", + " 0.012314243242144585,\n", + " -0.029758384451270103,\n", + " 0.02215069718658924,\n", + " 0.052344873547554016,\n", + " 0.01577567867934704,\n", + " 0.03227352723479271,\n", + " 0.04666712135076523,\n", + " -0.084319569170475,\n", + " 0.06703729927539825,\n", + " 0.018701713532209396,\n", + " -0.0397193506360054,\n", + " 0.11614485830068588,\n", + " 0.00895241741091013,\n", + " 0.05568179860711098,\n", + " 0.00722170015797019,\n", + " 0.010882354341447353,\n", + " 0.012899450026452541,\n", + " -0.022250305861234665,\n", + " -0.010595977306365967,\n", + " 0.0074769495986402035,\n", + " 0.009450466372072697,\n", + " -0.032348234206438065,\n", + " 0.023893866688013077,\n", + " 0.023943670094013214,\n", + " -0.022362368181347847,\n", + " -0.04447571188211441,\n", + " -0.04736439138650894,\n", + " 0.03222372382879257,\n", + " -0.015090862289071083,\n", + " -0.014082315377891064,\n", + " 0.044575318694114685,\n", + " 0.005229506641626358,\n", + " 0.05199623852968216,\n", + " 0.02095538191497326,\n", + " 0.08825415372848511,\n", + " 0.0069477735087275505,\n", + " 0.03346884250640869,\n", + " -0.0345645509660244,\n", + " -0.013907997868955135,\n", + " 0.033568453043699265,\n", + " 0.03396689146757126,\n", + " 0.019685357809066772,\n", + " -0.012986608780920506,\n", + " 0.06325212866067886,\n", + " 0.03434043005108833,\n", + " -0.029857993125915527,\n", + " 0.0627540796995163,\n", + " -0.011560945771634579,\n", + " 0.013509559445083141,\n", + " 0.1280980110168457,\n", + " 0.032945893704891205,\n", + " -0.04325549304485321,\n", + " 0.027417557314038277,\n", + " 0.03299569711089134,\n", + " 0.011000641621649265,\n", + " -0.017369434237480164,\n", + " 0.03680576756596565,\n", + " 0.045646123588085175,\n", + " 0.0345645509660244,\n", + " 0.02766658179461956,\n", + " -0.028089921921491623,\n", + " -0.029086019843816757,\n", + " -0.005836503114551306,\n", + " -1.956444430106785e-05,\n", + " -0.057375162839889526,\n", + " -0.00900844857096672,\n", + " 0.05269350856542587,\n", + " 0.06135954707860947,\n", + " -0.04230920225381851,\n", + " -0.026072826236486435,\n", + " 0.016609909012913704,\n", + " 0.015165570192039013,\n", + " -0.062455251812934875,\n", + " -0.030082115903496742,\n", + " -0.06041325628757477,\n", + " 0.05368960276246071,\n", + " -0.03929600864648819,\n", + " -0.035386331379413605,\n", + " 0.03394199162721634,\n", + " -0.0019641779363155365,\n", + " 0.015402142889797688,\n", + " 0.03939561918377876,\n", + " -0.05087563022971153,\n", + " 0.0014171029906719923,\n", + " 0.024964669719338417,\n", + " -0.032173916697502136,\n", + " -0.02064410038292408,\n", + " 0.031426846981048584,\n", + " -0.01313602365553379,\n", + " -0.012961706146597862,\n", + " 0.03224862739443779,\n", + " 0.010521269403398037,\n", + " 0.059417158365249634,\n", + " 0.017344530671834946,\n", + " -0.019747614860534668,\n", + " 0.03832481428980827,\n", + " 0.024117987602949142,\n", + " 0.03102840669453144,\n", + " 0.01138662826269865,\n", + " 0.015377240255475044,\n", + " -0.05637906491756439,\n", + " 0.020830869674682617,\n", + " 0.06270428001880646,\n", + " 0.03242294117808342,\n", + " 0.06683807820081711,\n", + " -0.01710795797407627,\n", + " -0.00917031429708004,\n", + " 0.0029244772158563137,\n", + " -0.044102173298597336,\n", + " 0.012899450026452541,\n", + " 0.003844310063868761,\n", + " -0.00202799029648304,\n", + " -0.012233310379087925,\n", + " -0.04370373487472534,\n", + " -0.06071208417415619,\n", + " 0.01928691938519478,\n", + " 0.02674519270658493,\n", + " -0.05334097146987915,\n", + " 0.02784089930355549,\n", + " 0.044276490807533264,\n", + " -0.035087499767541885,\n", + " 0.02674519270658493,\n", + " 0.05777360126376152,\n", + " 0.003831858979538083,\n", + " -0.05837125703692436,\n", + " 0.023806707933545113,\n", + " -0.0010583525290712714,\n", + " -0.03466416150331497,\n", + " -0.018614554777741432,\n", + " -0.040441520512104034,\n", + " 0.043653931468725204,\n", + " -0.026819899678230286,\n", + " -0.025462718680500984,\n", + " -0.011785067617893219,\n", + " 0.037278912961483,\n", + " 0.025500072166323662,\n", + " 0.028861897066235542,\n", + " 0.01299905963242054,\n", + " -0.02291022054851055,\n", + " 0.03466416150331497,\n", + " -0.0013571815798059106,\n", + " -0.009357081726193428,\n", + " 0.011666780337691307,\n", + " 0.030953699722886086,\n", + " -0.023171696811914444,\n", + " -0.01453055813908577,\n", + " 0.03588437661528587,\n", + " 0.01038430631160736,\n", + " 0.0127749377861619,\n", + " 0.038748156279325485,\n", + " 0.04385314881801605,\n", + " 0.044251587241888046,\n", + " -0.026222242042422295,\n", + " 0.02629694901406765,\n", + " 0.03665635362267494,\n", + " 0.03914659470319748,\n", + " -0.007483175490051508,\n", + " 0.04156212881207466,\n", + " -0.005827164743095636,\n", + " 0.018141407519578934,\n", + " 0.03132723644375801,\n", + " 0.057574380189180374,\n", + " 0.020245661959052086,\n", + " 0.02049468643963337,\n", + " 0.021054990589618683,\n", + " -0.03608359768986702,\n", + " 0.06743573397397995,\n", + " -0.02629694901406765,\n", + " 0.03899718075990677,\n", + " -0.022648746147751808,\n", + " -0.00023112552298698574,\n", + " 0.030779384076595306,\n", + " -0.015016155317425728,\n", + " 0.08944947272539139,\n", + " 0.003940807189792395,\n", + " -0.010795196518301964,\n", + " 0.08944947272539139,\n", + " 0.0013065985403954983,\n", + " 0.0589689165353775,\n", + " 0.0022038635797798634,\n", + " 0.05483511462807655,\n", + " 0.05249428749084473,\n", + " 0.02903621457517147,\n", + " 0.027492264285683632,\n", + " 0.039046984165906906,\n", + " 0.04031700640916824,\n", + " -0.03224862739443779,\n", + " 0.02109234407544136,\n", + " 0.013472205959260464,\n", + " 0.00710963923484087,\n", + " 0.0018801322439685464,\n", + " 0.07824338227510452,\n", + " -0.029310140758752823,\n", + " 0.0299576036632061,\n", + " 0.03625791519880295,\n", + " -0.037527937442064285,\n", + " 0.009045802056789398,\n", + " -0.030206628143787384,\n", + " -0.05777360126376152,\n", + " -0.005926774349063635,\n", + " -0.03685557097196579,\n", + " -0.016062056645751,\n", + " -0.008771874941885471,\n", + " -0.056628089398145676,\n", + " 0.03653183951973915,\n", + " 0.06454705446958542,\n", + " 0.0010863677598536015,\n", + " -0.0311778225004673,\n", + " 0.01383329089730978,\n", + " -0.025898510590195656,\n", + " -0.033842381089925766,\n", + " 0.033991795033216476,\n", + " 0.04711536690592766,\n", + " 0.0013330572983250022,\n", + " 0.020669003948569298,\n", + " -0.011616976000368595,\n", + " 0.007339986506849527,\n", + " -0.04036681354045868,\n", + " 0.06434783339500427,\n", + " -0.0039594839327037334,\n", + " 0.0016030928818508983,\n", + " 0.0018412221688777208,\n", + " 0.06907929480075836,\n", + " 0.0075827850960195065,\n", + " -0.037851668894290924,\n", + " -0.04524768516421318,\n", + " 0.004796827211976051,\n", + " -0.04477453976869583,\n", + " 0.04049132391810417,\n", + " 0.02629694901406765,\n", + " 0.06658905744552612,\n", + " -0.03152645751833916,\n", + " -0.021030088886618614,\n", + " 0.00033482073922641575,\n", + " 0.04176134616136551,\n", + " -0.037054792046546936,\n", + " 0.002045110799372196,\n", + " -0.019075248390436172,\n", + " 0.034489843994379044,\n", + " 0.03194979578256607,\n", + " -0.029559165239334106,\n", + " 0.022250305861234665,\n", + " 0.015327435918152332,\n", + " 0.008510399609804153\n", + " ],\n", + " [\n", + " -0.04720204323530197,\n", + " 0.05372468754649162,\n", + " -0.046604547649621964,\n", + " -0.0002438990049995482,\n", + " 0.017875034362077713,\n", + " -0.06612268835306168,\n", + " 0.05760839954018593,\n", + " 0.002856769133359194,\n", + " 0.029426589608192444,\n", + " 0.011090986430644989,\n", + " -0.00892507005482912,\n", + " 0.04595726355910301,\n", + " -0.027758585289120674,\n", + " -0.019331427291035652,\n", + " -0.013095080852508545,\n", + " 0.0401814840734005,\n", + " 0.016655150800943375,\n", + " -0.0021643606014549732,\n", + " -0.051035962998867035,\n", + " 0.010972731746733189,\n", + " -0.021970359608530998,\n", + " 0.015821147710084915,\n", + " -0.03336009383201599,\n", + " -0.0015948738437145948,\n", + " 0.012435347773134708,\n", + " -0.04797380417585373,\n", + " 0.00888772588223219,\n", + " -0.026787657290697098,\n", + " -0.062139395624399185,\n", + " 0.038065358996391296,\n", + " -0.009391861967742443,\n", + " 0.042222924530506134,\n", + " -0.014601264148950577,\n", + " 0.02853034809231758,\n", + " 0.0029921389650553465,\n", + " 0.052479907870292664,\n", + " 0.014302517287433147,\n", + " 0.0427706278860569,\n", + " -0.002928344067186117,\n", + " -0.008551635779440403,\n", + " 0.05347573012113571,\n", + " 0.06358334422111511,\n", + " -0.015036937780678272,\n", + " 0.04481206461787224,\n", + " -0.04941774904727936,\n", + " 0.03057178668677807,\n", + " -0.04072918742895126,\n", + " 0.04209844395518303,\n", + " 0.03378331661224365,\n", + " -0.010804686695337296,\n", + " -0.023999350145459175,\n", + " 0.049766287207603455,\n", + " 0.03400737792253494,\n", + " 0.026165267452597618,\n", + " -0.05407322570681572,\n", + " 0.0045496695674955845,\n", + " 0.007132587023079395,\n", + " 0.03644714504480362,\n", + " 0.009310951456427574,\n", + " 0.037218909710645676,\n", + " -0.04777463898062706,\n", + " -0.015223653987050056,\n", + " 0.011613793671131134,\n", + " -0.012391780503094196,\n", + " 0.005461470223963261,\n", + " 0.041824594140052795,\n", + " 0.04366686940193176,\n", + " -0.07020556926727295,\n", + " -0.003497830592095852,\n", + " -0.054521344602108,\n", + " -0.0234391987323761,\n", + " 0.0157464612275362,\n", + " 0.07125118374824524,\n", + " 0.06343396753072739,\n", + " -0.03316092863678932,\n", + " 0.025916310027241707,\n", + " -0.038488585501909256,\n", + " 0.03171698376536369,\n", + " -0.030024083331227303,\n", + " 0.01488756388425827,\n", + " -0.018584558740258217,\n", + " -0.016667598858475685,\n", + " 0.016704941168427467,\n", + " 0.021074118092656136,\n", + " 0.0314929224550724,\n", + " 0.05526821315288544,\n", + " -0.02450970932841301,\n", + " 0.004188683349639177,\n", + " -0.015348132699728012,\n", + " 0.0005368111887946725,\n", + " 0.019829338416457176,\n", + " -0.03659651800990105,\n", + " 0.02663828246295452,\n", + " 0.04048023372888565,\n", + " 0.08474459499120712,\n", + " -0.027161089703440666,\n", + " -0.055666543543338776,\n", + " 0.014937355183064938,\n", + " 0.03916076570749283,\n", + " 0.008999756537377834,\n", + " 0.03438081219792366,\n", + " -0.003351568942889571,\n", + " 0.02619016170501709,\n", + " 0.03082074224948883,\n", + " -0.005579724442213774,\n", + " 0.007406438700854778,\n", + " 0.09121745079755783,\n", + " -0.025044964626431465,\n", + " -0.015460162423551083,\n", + " -0.02952617220580578,\n", + " 0.05277865380048752,\n", + " -0.038040462881326675,\n", + " 0.014962250366806984,\n", + " -0.0031819678843021393,\n", + " 0.015659326687455177,\n", + " 0.037218909710645676,\n", + " 0.09370701014995575,\n", + " -0.04530997574329376,\n", + " -0.038886915892362595,\n", + " 0.03791598603129387,\n", + " 0.0027042836882174015,\n", + " 0.00019702526333276182,\n", + " 0.023128004744648933,\n", + " -0.06437999755144119,\n", + " 0.005200066603720188,\n", + " 0.012553602457046509,\n", + " 0.015970522537827492,\n", + " 0.0013692575739696622,\n", + " 0.030447307974100113,\n", + " 0.04573320224881172,\n", + " 0.007929245941340923,\n", + " 0.0017893706681206822,\n", + " 0.011694704182446003,\n", + " 0.022082390263676643,\n", + " 0.0009289167355746031,\n", + " -0.0460568442940712,\n", + " -0.0763796716928482,\n", + " 0.0230284221470356,\n", + " -0.004353616386651993,\n", + " 0.023202691227197647,\n", + " 0.026563595980405807,\n", + " -0.02073802798986435,\n", + " 0.019431009888648987,\n", + " 0.007574483752250671,\n", + " -0.014389651827514172,\n", + " -0.02511965110898018,\n", + " -0.024820905178785324,\n", + " 0.01700368896126747,\n", + " 0.021858328953385353,\n", + " 0.04152584820985794,\n", + " 0.06413104385137558,\n", + " 0.007711409591138363,\n", + " 0.04672902449965477,\n", + " -0.025617564097046852,\n", + " -0.011607569642364979,\n", + " 0.07652904838323593,\n", + " -0.0007118583307601511,\n", + " 0.0344306044280529,\n", + " -0.0024942271411418915,\n", + " 0.047650162130594254,\n", + " -0.0253810565918684,\n", + " -0.0057944487780332565,\n", + " 0.0009079111041501164,\n", + " -0.006009173579514027,\n", + " 0.016667598858475685,\n", + " 0.0323144793510437,\n", + " 0.024833353236317635,\n", + " 0.010505939833819866,\n", + " -0.01930653117597103,\n", + " 0.044563110917806625,\n", + " -0.0036160845775157213,\n", + " -0.0063483756966888905,\n", + " -0.013431171886622906,\n", + " 0.02388731949031353,\n", + " 0.020389489829540253,\n", + " 0.025841623544692993,\n", + " 0.09276097267866135,\n", + " 0.10042881965637207,\n", + " -0.05108575522899628,\n", + " 0.023737946525216103,\n", + " 0.02748473361134529,\n", + " 0.04879536107182503,\n", + " -0.06806454807519913,\n", + " 0.019119814038276672,\n", + " 0.04416478052735329,\n", + " -0.009111786261200905,\n", + " 0.061492111533880234,\n", + " -0.026513805612921715,\n", + " 0.019791996106505394,\n", + " 0.024596843868494034,\n", + " 0.02658849209547043,\n", + " 0.03457997739315033,\n", + " 0.02221931517124176,\n", + " 0.0209745354950428,\n", + " 0.05051315575838089,\n", + " -0.026961926370859146,\n", + " -0.024820905178785324,\n", + " -7.964644464664161e-05,\n", + " 0.028978468850255013,\n", + " -0.02406158857047558,\n", + " 0.012441571801900864,\n", + " 0.01635640300810337,\n", + " 0.016169685870409012,\n", + " -0.03368373587727547,\n", + " 0.025841623544692993,\n", + " -0.005178282968699932,\n", + " 0.008757024072110653,\n", + " -0.014675951562821865,\n", + " 0.04189928248524666,\n", + " 0.034057170152664185,\n", + " 0.01611989550292492,\n", + " 0.03199083358049393,\n", + " -0.0368952676653862,\n", + " 0.04819786548614502,\n", + " 0.008526740595698357,\n", + " 0.02347654290497303,\n", + " 0.03286218270659447,\n", + " 0.011128329671919346,\n", + " 0.0004348948714323342,\n", + " 0.01384194940328598,\n", + " 0.013680127449333668,\n", + " 0.016667598858475685,\n", + " 0.0679151713848114,\n", + " 0.027111299335956573,\n", + " 0.003342233132570982,\n", + " -0.021011879667639732,\n", + " 0.04142626374959946,\n", + " 0.03565048798918724,\n", + " 0.036347564309835434,\n", + " -0.05999837443232536,\n", + " 0.06527624279260635,\n", + " -0.011103433556854725,\n", + " -0.005358776077628136,\n", + " -0.021534686908125877,\n", + " 0.02768389880657196,\n", + " -0.03293686732649803,\n", + " -0.011551554314792156,\n", + " -0.00392105570062995,\n", + " -0.016306612640619278,\n", + " -0.015099176205694675,\n", + " -0.03209041804075241,\n", + " -0.027559420093894005,\n", + " -0.002607813337817788,\n", + " -0.01930653117597103,\n", + " 0.03482893109321594,\n", + " 0.05496946722269058,\n", + " -0.016493329778313637,\n", + " 0.019630173221230507,\n", + " 0.06647122651338577,\n", + " -0.04356728494167328,\n", + " -0.01163868885487318,\n", + " 0.04003211110830307,\n", + " 0.05118533596396446,\n", + " 0.06253772974014282,\n", + " 0.04438883811235428,\n", + " -0.07886923104524612,\n", + " 0.022057494148612022,\n", + " 0.03898649662733078,\n", + " 0.013294246047735214,\n", + " 0.02516944333910942,\n", + " 0.03042241372168064,\n", + " 0.006379495374858379,\n", + " 0.03918566182255745,\n", + " 0.016829419881105423,\n", + " -0.0038463689852505922,\n", + " 0.032189998775720596,\n", + " 0.02511965110898018,\n", + " -0.02516944333910942,\n", + " -0.02556777186691761,\n", + " 0.02266743592917919,\n", + " 0.01695389859378338,\n", + " -0.012341989204287529,\n", + " -0.01697879284620285,\n", + " 0.027360254898667336,\n", + " -0.03079584613442421,\n", + " -0.0001315770932706073,\n", + " -0.059849001467227936,\n", + " 0.07354157418012619,\n", + " 0.027559420093894005,\n", + " -0.017862586304545403,\n", + " 0.012615840882062912,\n", + " -0.05631382763385773,\n", + " -0.005501925945281982,\n", + " 0.004394072107970715,\n", + " 0.028654826804995537,\n", + " 0.04934306442737579,\n", + " 0.05576612427830696,\n", + " -0.0027089514769613743,\n", + " 0.04102793335914612,\n", + " 0.006015397142618895,\n", + " -0.017875034362077713,\n", + " 0.0015746462158858776,\n", + " 0.06567457318305969,\n", + " -0.053127191960811615,\n", + " -0.002799198031425476,\n", + " -0.044737379997968674,\n", + " 0.05765819177031517,\n", + " 0.01227352675050497,\n", + " 0.040156587958335876,\n", + " -0.021684059873223305,\n", + " 0.0067467051558196545,\n", + " -0.0011833185562863946,\n", + " 0.010717552155256271,\n", + " -0.0334845706820488,\n", + " 0.02980002388358116,\n", + " 0.02853034809231758,\n", + " -0.0548698827624321,\n", + " 0.014190487563610077,\n", + " 0.02701171673834324,\n", + " -0.07632988691329956,\n", + " 0.03863795846700668,\n", + " 0.045359767973423004,\n", + " 0.03619819134473801,\n", + " -0.014601264148950577,\n", + " -0.019368769600987434,\n", + " -0.021099014207720757,\n", + " -0.05223095044493675,\n", + " -0.0750851035118103,\n", + " -0.0033453451469540596,\n", + " -0.034032274037599564,\n", + " 0.0058255684562027454,\n", + " 0.0013140204828232527,\n", + " 0.09221327304840088,\n", + " -0.02683744765818119,\n", + " 0.021099014207720757,\n", + " -0.007985261268913746,\n", + " -0.015895836055278778,\n", + " 0.03393269330263138,\n", + " 0.013792158104479313,\n", + " -0.042621251195669174,\n", + " -0.0234391987323761,\n", + " -0.03368373587727547,\n", + " 0.014364756643772125,\n", + " -0.004745722282677889,\n", + " 0.04468758776783943,\n", + " -0.04486185684800148,\n", + " -0.021410208195447922,\n", + " 0.0640314593911171,\n", + " -0.011657360941171646,\n", + " -0.041575636714696884,\n", + " -0.016468433663249016,\n", + " -0.0035662935115396976,\n", + " 0.019431009888648987,\n", + " 0.0653260350227356,\n", + " 0.041625428944826126,\n", + " 0.03380821272730827,\n", + " -0.05243011564016342,\n", + " 0.030671369284391403,\n", + " -0.011501763015985489,\n", + " 0.0016788964858278632,\n", + " 0.03146802634000778,\n", + " -0.0031695200596004725,\n", + " 0.010095162317156792,\n", + " -0.0034573753364384174,\n", + " 0.039534199982881546,\n", + " -0.04107772558927536,\n", + " 0.0640314593911171,\n", + " -0.03709443286061287,\n", + " -0.000380630255676806,\n", + " 0.003852592781186104,\n", + " 0.014290069229900837,\n", + " -0.005007125902920961,\n", + " -0.011651136912405491,\n", + " 0.044762272387742996,\n", + " 0.004026861861348152,\n", + " 0.06881141662597656,\n", + " 0.0289037823677063,\n", + " -0.06881141662597656,\n", + " -0.016032760962843895,\n", + " 0.008302680216729641,\n", + " -0.02281680889427662,\n", + " 0.008452053181827068,\n", + " -0.06144231930375099,\n", + " 0.011178120970726013,\n", + " -0.07115159928798676,\n", + " 0.02661338821053505,\n", + " 0.03286218270659447,\n", + " 0.052479907870292664,\n", + " 0.03350946679711342,\n", + " -0.007997708395123482,\n", + " 0.03814004734158516,\n", + " 0.02346409484744072,\n", + " 0.046430278569459915,\n", + " -0.057309653609991074,\n", + " -0.02683744765818119,\n", + " 0.0015303009422495961,\n", + " -0.012846125289797783,\n", + " -0.00892507005482912,\n", + " 0.005137827713042498,\n", + " -0.0297253355383873,\n", + " 0.026239953935146332,\n", + " 0.05636361986398697,\n", + " 0.04837213456630707,\n", + " 0.00461813248693943,\n", + " -0.006339040119200945,\n", + " 0.011551554314792156,\n", + " 0.005999837536364794,\n", + " 0.005228074267506599,\n", + " 0.056911323219537735,\n", + " -0.03582475706934929,\n", + " 0.05093638226389885,\n", + " -0.0035320620518177748,\n", + " 0.011981003917753696,\n", + " 0.07792320102453232,\n", + " 0.053525522351264954,\n", + " -0.06268709897994995,\n", + " 0.030048979446291924,\n", + " 0.027086403220891953,\n", + " -0.011595121584832668,\n", + " 0.036571625620126724,\n", + " 0.06686955690383911,\n", + " 0.030546890571713448,\n", + " 0.016082551330327988,\n", + " -0.07209763675928116,\n", + " -0.02138531394302845,\n", + " 0.011532883159816265,\n", + " -0.02515699528157711,\n", + " 0.029824918136000633,\n", + " 0.04252167046070099,\n", + " 0.059201717376708984,\n", + " -0.0019076247699558735,\n", + " 0.015609536319971085,\n", + " 0.006877407431602478,\n", + " 0.024472367018461227,\n", + " 0.010082714259624481,\n", + " 0.04506102204322815,\n", + " 0.025007622316479683,\n", + " 0.036795683205127716,\n", + " 0.0699068233370781,\n", + " 0.05686153098940849,\n", + " -0.04043044149875641,\n", + " 0.07712654024362564,\n", + " -0.0050506931729614735,\n", + " 0.03368373587727547,\n", + " 0.0220325980335474,\n", + " -0.00974040012806654,\n", + " -0.024858247488737106,\n", + " 0.01672983728349209,\n", + " 0.05890297144651413,\n", + " -0.0035943009424954653,\n", + " 0.043119166046381,\n", + " 0.025517981499433517,\n", + " 0.051284920424222946,\n", + " 0.010344117879867554,\n", + " 0.04966670647263527,\n", + " -0.024870695546269417,\n", + " -0.002579805674031377,\n", + " -0.000398329459130764,\n", + " 0.055467378348112106,\n", + " 0.03144313395023346,\n", + " 0.02220686711370945,\n", + " -0.045359767973423004,\n", + " -0.002785194432362914,\n", + " -0.055417586117982864,\n", + " 0.021646717563271523,\n", + " 0.02113635651767254,\n", + " 0.08798102289438248,\n", + " 0.02098698355257511,\n", + " 0.02850545197725296,\n", + " -0.02785816788673401,\n", + " 0.006964541971683502,\n", + " -0.002540906425565481,\n", + " -0.027808375656604767,\n", + " 0.019219396635890007,\n", + " 0.0021503567695617676,\n", + " -0.013705023564398289,\n", + " 0.07881944626569748,\n", + " -0.013344037346541882,\n", + " 0.06876162439584732,\n", + " 0.06258751451969147,\n", + " -0.013468515127897263,\n", + " -0.0024179844185709953,\n", + " 0.027708793058991432,\n", + " 0.010008027777075768,\n", + " 0.04381624236702919,\n", + " 0.004282041918486357,\n", + " 0.05845484882593155,\n", + " -0.02932700701057911,\n", + " -0.01843518577516079,\n", + " -0.05213136970996857,\n", + " -0.0028256496880203485,\n", + " -0.003606748767197132,\n", + " 0.010929164476692677,\n", + " -0.07015577703714371,\n", + " 0.039957426488399506,\n", + " 0.0184476338326931,\n", + " 0.053575314581394196,\n", + " 0.03968357294797897,\n", + " 0.026663178578019142,\n", + " -0.009273608215153217,\n", + " -0.02345164678990841,\n", + " -0.011059866286814213,\n", + " 0.046604547649621964,\n", + " 0.09465304017066956,\n", + " -0.027210881933569908,\n", + " -0.02224421128630638,\n", + " 0.019231844693422318,\n", + " -0.10142464190721512,\n", + " -0.03159250691533089,\n", + " -0.043293435126543045,\n", + " -0.01258472166955471,\n", + " 0.07159972190856934,\n", + " -0.0171530619263649,\n", + " -0.0031897476874291897,\n", + " 0.052928026765584946,\n", + " -0.0629858449101448,\n", + " 0.046679235994815826,\n", + " 0.022381136193871498,\n", + " 0.009142906405031681,\n", + " -0.011028747074306011,\n", + " -0.031293757259845734,\n", + " -0.03251364454627037,\n", + " 0.024435022845864296,\n", + " -0.02411138080060482,\n", + " 0.0022966184187680483,\n", + " 0.014028665609657764,\n", + " 0.03164229542016983,\n", + " -0.04884514957666397,\n", + " 0.006329704076051712,\n", + " 0.11083517223596573,\n", + " 0.03440570831298828,\n", + " -0.02033969759941101,\n", + " -0.029302110895514488,\n", + " -0.0339575856924057,\n", + " 0.0006749039166606963,\n", + " -0.013966427184641361,\n", + " 0.031343549489974976,\n", + " 0.03199083358049393,\n", + " 0.03209041804075241,\n", + " 0.037841297686100006,\n", + " 0.058753594756126404,\n", + " -0.06567457318305969,\n", + " 0.05686153098940849,\n", + " 0.025443295016884804,\n", + " -0.04615642875432968,\n", + " 0.1227850615978241,\n", + " -0.005495701916515827,\n", + " 0.031343549489974976,\n", + " -0.005872247740626335,\n", + " -0.004593236837536097,\n", + " -0.00277741439640522,\n", + " -0.02409893274307251,\n", + " -0.011632464826107025,\n", + " 0.0005403121467679739,\n", + " 0.009821310639381409,\n", + " -0.034106962382793427,\n", + " 0.034779142588377,\n", + " 0.02182098664343357,\n", + " -0.021883225068449974,\n", + " -0.05735944211483002,\n", + " -0.03440570831298828,\n", + " 0.0184476338326931,\n", + " 0.0017784788506105542,\n", + " 0.004110884387046099,\n", + " 0.03684547543525696,\n", + " 0.012180168181657791,\n", + " 0.0669691413640976,\n", + " 0.020215220749378204,\n", + " 0.047699954360723495,\n", + " 0.0004940219223499298,\n", + " 0.005741545930504799,\n", + " -0.014787981286644936,\n", + " 0.02511965110898018,\n", + " 0.05148408189415932,\n", + " 0.027285568416118622,\n", + " 0.00861387513577938,\n", + " -0.0016446650261059403,\n", + " 0.045583829283714294,\n", + " 0.04466269165277481,\n", + " -0.03079584613442421,\n", + " 0.035725172609090805,\n", + " 0.005953158251941204,\n", + " 0.008539187721908092,\n", + " 0.11800510436296463,\n", + " 0.01415314432233572,\n", + " -0.07513489574193954,\n", + " 0.043890926986932755,\n", + " 0.039285242557525635,\n", + " 0.01109720952808857,\n", + " -0.00021686394757125527,\n", + " 0.03226468712091446,\n", + " 0.004148228093981743,\n", + " 0.040953248739242554,\n", + " 0.02301597408950329,\n", + " -0.011427076533436775,\n", + " -0.027982644736766815,\n", + " -0.01235443726181984,\n", + " -0.004664811305701733,\n", + " -0.057309653609991074,\n", + " -0.030273038893938065,\n", + " 0.05008992925286293,\n", + " 0.027285568416118622,\n", + " -0.032563433051109314,\n", + " -0.036397356539964676,\n", + " 0.020700683817267418,\n", + " 0.023526333272457123,\n", + " -0.05979921296238899,\n", + " -0.022891497239470482,\n", + " -0.05531800538301468,\n", + " 0.027111299335956573,\n", + " -0.038040462881326675,\n", + " -0.032588329166173935,\n", + " 0.02619016170501709,\n", + " 0.052529700100421906,\n", + " 0.02765900269150734,\n", + " 0.03916076570749283,\n", + " -0.038862019777297974,\n", + " 0.011738271452486515,\n", + " 0.011395957320928574,\n", + " -0.011968555860221386,\n", + " -0.020252563059329987,\n", + " 0.04401540756225586,\n", + " -0.002047662390395999,\n", + " -0.021447552368044853,\n", + " 0.044139884412288666,\n", + " 0.041799698024988174,\n", + " 0.08310148864984512,\n", + " -0.02535616047680378,\n", + " -0.014215382747352123,\n", + " 0.025194339454174042,\n", + " 0.009485220536589622,\n", + " 0.04889494180679321,\n", + " 0.04443863034248352,\n", + " -0.013717470690608025,\n", + " -0.07000640034675598,\n", + " 0.03228958323597908,\n", + " 0.07642946392297745,\n", + " 0.03445550054311752,\n", + " 0.0891760066151619,\n", + " -0.014190487563610077,\n", + " 0.02490803971886635,\n", + " 0.00826533604413271,\n", + " -0.024161171168088913,\n", + " 0.034032274037599564,\n", + " -0.008539187721908092,\n", + " 0.002740071155130863,\n", + " -0.003426255891099572,\n", + " -0.013667679391801357,\n", + " -0.03418164700269699,\n", + " 0.024646636098623276,\n", + " 0.016393747180700302,\n", + " -0.03704464063048363,\n", + " 0.056712158024311066,\n", + " 0.055865708738565445,\n", + " 0.007176154293119907,\n", + " 0.04588257521390915,\n", + " 0.039733365178108215,\n", + " 0.010972731746733189,\n", + " -0.0401814840734005,\n", + " 0.025032516568899155,\n", + " -0.027559420093894005,\n", + " -0.017924826592206955,\n", + " 0.011171896941959858,\n", + " -0.024173619225621223,\n", + " 0.030297935009002686,\n", + " -0.015148967504501343,\n", + " -0.02621505782008171,\n", + " -0.017949720844626427,\n", + " 0.051284920424222946,\n", + " -0.004963558632880449,\n", + " 0.0011778726475313306,\n", + " 0.03191614896059036,\n", + " -0.030024083331227303,\n", + " 0.037393178790807724,\n", + " -0.008078619837760925,\n", + " -0.00398329459130764,\n", + " 0.020700683817267418,\n", + " 0.053575314581394196,\n", + " -0.02601589262485504,\n", + " 0.009952012449502945,\n", + " 0.020862506702542305,\n", + " 0.030073875561356544,\n", + " 0.010537059046328068,\n", + " 0.04568341001868248,\n", + " 0.017140615731477737,\n", + " 0.020650893449783325,\n", + " -0.016244374215602875,\n", + " 0.03226468712091446,\n", + " 0.025916310027241707,\n", + " 0.03457997739315033,\n", + " -0.0025051189586520195,\n", + " 0.046604547649621964,\n", + " -0.024036694318056107,\n", + " 0.027758585289120674,\n", + " 0.03057178668677807,\n", + " 0.0629858449101448,\n", + " 0.02351388707756996,\n", + " 0.022779466584324837,\n", + " 0.022505614906549454,\n", + " -0.01883351430296898,\n", + " 0.04695308580994606,\n", + " -0.041401367634534836,\n", + " 0.033036451786756516,\n", + " -0.0072197215631604195,\n", + " 0.0006441734149120748,\n", + " 0.08822997659444809,\n", + " -0.03438081219792366,\n", + " 0.06751684099435806,\n", + " 0.035600695759058,\n", + " -0.033882901072502136,\n", + " 0.05467071756720543,\n", + " 0.028256496414542198,\n", + " 0.04366686940193176,\n", + " 0.0051471637561917305,\n", + " 0.04132668301463127,\n", + " 0.012385556474328041,\n", + " 0.020202772691845894,\n", + " 0.03306134417653084,\n", + " 0.03355925902724266,\n", + " 0.04590747132897377,\n", + " -0.010107610374689102,\n", + " 0.008638770319521427,\n", + " 0.005900255404412746,\n", + " 0.027111299335956573,\n", + " 0.0046212440356612206,\n", + " 0.06766621768474579,\n", + " -0.03779150918126106,\n", + " 0.029277216643095016,\n", + " 0.050388678908348083,\n", + " -0.03166719153523445,\n", + " 0.0002627651847433299,\n", + " -0.005461470223963261,\n", + " -0.071201391518116,\n", + " -0.00022347683261614293,\n", + " -0.05048825964331627,\n", + " -0.025493085384368896,\n", + " -0.021634269505739212,\n", + " -0.06263730674982071,\n", + " 0.020165428519248962,\n", + " 0.0532267764210701,\n", + " -0.007001885212957859,\n", + " -0.022916391491889954,\n", + " 0.009665713645517826,\n", + " -0.012074361555278301,\n", + " -0.010151177644729614,\n", + " 0.04316895455121994,\n", + " 0.015447714366018772,\n", + " -0.019978713244199753,\n", + " -0.002301286207512021,\n", + " 0.008097290992736816,\n", + " 0.023862425237894058,\n", + " -0.03378331661224365,\n", + " 0.03692016378045082,\n", + " 0.03891180828213692,\n", + " 0.01763852685689926,\n", + " 0.0027494069654494524,\n", + " 0.06437999755144119,\n", + " -0.018348051235079765,\n", + " -0.05317698419094086,\n", + " -0.04481206461787224,\n", + " -0.004157563671469688,\n", + " -0.08499354869127274,\n", + " 0.06343396753072739,\n", + " 0.03584965318441391,\n", + " 0.03627287596464157,\n", + " 0.020289907231926918,\n", + " -0.03293686732649803,\n", + " -0.008831711485981941,\n", + " 0.03903628885746002,\n", + " -0.048944734036922455,\n", + " 0.04613153263926506,\n", + " 0.003326673526316881,\n", + " 0.028132017701864243,\n", + " 0.04361707717180252,\n", + " -0.060247331857681274,\n", + " 0.02493293583393097,\n", + " 0.02076292410492897,\n", + " -0.03545132279396057\n", + " ],\n", + " [\n", + " -0.032059941440820694,\n", + " 0.06338174641132355,\n", + " -0.022550221532583237,\n", + " 0.017358625307679176,\n", + " 0.007190728094428778,\n", + " -0.01609148271381855,\n", + " 0.06963134557008743,\n", + " -0.0008196445414796472,\n", + " 0.04962771013379097,\n", + " 0.02225496433675289,\n", + " -0.015476365573704243,\n", + " 0.04303364455699921,\n", + " -0.0003500405000522733,\n", + " -0.016977252438664436,\n", + " 0.0004659517726395279,\n", + " 0.042664576321840286,\n", + " 0.013348057866096497,\n", + " -0.018921025097370148,\n", + " -0.020015934482216835,\n", + " 0.0029510280583053827,\n", + " -0.023903479799628258,\n", + " -0.003850637935101986,\n", + " -0.02162754349410534,\n", + " 0.0065633077174425125,\n", + " 0.0060865911655128,\n", + " -0.059691037982702255,\n", + " -0.022845476865768433,\n", + " -0.03405292332172394,\n", + " -0.06003550440073013,\n", + " 0.04463295266032219,\n", + " 0.0016808095388114452,\n", + " 0.046084631234407425,\n", + " -0.012905173003673553,\n", + " 0.013938571326434612,\n", + " -0.003970585763454437,\n", + " 0.02259943075478077,\n", + " 0.027311233803629875,\n", + " 0.03314255177974701,\n", + " -0.024014201015233994,\n", + " -0.010112538002431393,\n", + " 0.057575032114982605,\n", + " 0.059887874871492386,\n", + " 0.013926268555223942,\n", + " 0.025441275909543037,\n", + " -0.019240885972976685,\n", + " 0.012333113700151443,\n", + " -0.022673243656754494,\n", + " 0.03309334069490433,\n", + " 0.029058167710900307,\n", + " 0.010967551730573177,\n", + " -0.014516782015562057,\n", + " 0.07760327309370041,\n", + " 0.024986088275909424,\n", + " 0.01992981880903244,\n", + " -0.029845518991351128,\n", + " 0.03752218931913376,\n", + " 0.03461883217096329,\n", + " 0.012517648749053478,\n", + " -0.010524666868150234,\n", + " 0.056443214416503906,\n", + " -0.04293522611260414,\n", + " -0.007295297924429178,\n", + " -0.027901746332645416,\n", + " -0.006778598763048649,\n", + " 0.0068708667531609535,\n", + " 0.03695628046989441,\n", + " 0.04928324371576309,\n", + " -0.04918482527136803,\n", + " 0.008790033869445324,\n", + " -0.05688609927892685,\n", + " -0.01377863995730877,\n", + " -0.011416587978601456,\n", + " 0.04736407473683357,\n", + " 0.06431672722101212,\n", + " -0.033831480890512466,\n", + " -0.0030509845819324255,\n", + " -0.06328332424163818,\n", + " 0.05693531036376953,\n", + " -0.012099368497729301,\n", + " 0.0016008442034944892,\n", + " -0.0367102324962616,\n", + " -0.019585352391004562,\n", + " 0.0328965038061142,\n", + " 0.04369797185063362,\n", + " 0.011742600239813328,\n", + " 0.05211278423666954,\n", + " -0.03983503207564354,\n", + " 0.017690788954496384,\n", + " 0.005619101691991091,\n", + " 0.0069446805864572525,\n", + " 0.009835734963417053,\n", + " -0.07081236690282822,\n", + " 0.008088800124824047,\n", + " 0.06328332424163818,\n", + " 0.0578702874481678,\n", + " -0.025908764451742172,\n", + " -0.08104792982339859,\n", + " 0.01034628227353096,\n", + " 0.01187792606651783,\n", + " 0.004668744746595621,\n", + " 0.014344548806548119,\n", + " 0.014516782015562057,\n", + " 0.04640449211001396,\n", + " 0.015021177940070629,\n", + " -0.019892912358045578,\n", + " 0.031321801245212555,\n", + " 0.06825347989797592,\n", + " -0.02989472821354866,\n", + " -0.005917433649301529,\n", + " -0.019450027495622635,\n", + " 0.05270329862833023,\n", + " -0.03806349262595177,\n", + " 0.018145976588129997,\n", + " -0.0028726004529744387,\n", + " 0.02123386785387993,\n", + " 0.04295983165502548,\n", + " 0.07125525176525116,\n", + " -0.059297364205121994,\n", + " -0.009275977499783039,\n", + " 0.04367337003350258,\n", + " 0.009503571316599846,\n", + " -0.011256656609475613,\n", + " 0.024026503786444664,\n", + " -0.034397389739751816,\n", + " 0.010758411139249802,\n", + " 0.021947406232357025,\n", + " 0.04200024902820587,\n", + " 0.004318127408623695,\n", + " 0.027089791372418404,\n", + " 0.03424976393580437,\n", + " 0.024100318551063538,\n", + " -0.0075105889700353146,\n", + " 0.001143350382335484,\n", + " 0.005059344228357077,\n", + " 0.004797919187694788,\n", + " -0.04278760030865669,\n", + " -0.05516377091407776,\n", + " 0.010819923132658005,\n", + " -0.00350002059713006,\n", + " 0.008783883415162563,\n", + " 0.015008876100182533,\n", + " -0.003057135734707117,\n", + " 0.01932700350880623,\n", + " 0.015660900622606277,\n", + " 0.0065140980295836926,\n", + " -0.037866655737161636,\n", + " -0.023657433688640594,\n", + " 0.0208894032984972,\n", + " 0.05043966695666313,\n", + " 0.0467243529856205,\n", + " 0.0835576131939888,\n", + " 0.005105478223413229,\n", + " 0.04020410403609276,\n", + " 0.025957973673939705,\n", + " -0.016226809471845627,\n", + " 0.043378110975027084,\n", + " -0.002694216324016452,\n", + " 0.04025331139564514,\n", + " 0.021332288160920143,\n", + " 0.035356976091861725,\n", + " -0.004899413790553808,\n", + " -0.015316435135900974,\n", + " 0.023485200479626656,\n", + " 0.011508855037391186,\n", + " 0.031912315636873245,\n", + " 0.03358543664216995,\n", + " 0.04133592173457146,\n", + " 0.01895793341100216,\n", + " -0.004825599491596222,\n", + " 0.03912149742245674,\n", + " -0.011244354769587517,\n", + " 0.008279486559331417,\n", + " -0.026671510189771652,\n", + " 0.031198779121041298,\n", + " 0.0038444867823272943,\n", + " 0.04180340841412544,\n", + " 0.09950146824121475,\n", + " 0.055065352469682693,\n", + " -0.06426751613616943,\n", + " -0.0014116954989731312,\n", + " 0.02104933373630047,\n", + " 0.018453536555171013,\n", + " -0.06618668138980865,\n", + " 0.03693167492747307,\n", + " 0.0330195277929306,\n", + " -0.013261941261589527,\n", + " 0.052604880183935165,\n", + " -0.006151178851723671,\n", + " -0.017715394496917725,\n", + " 0.009528175927698612,\n", + " 0.03262585029006004,\n", + " 0.042074061930179596,\n", + " 0.029574867337942123,\n", + " 0.04652751609683037,\n", + " 0.028295421972870827,\n", + " -0.05693531036376953,\n", + " -0.044140856713056564,\n", + " 0.005548363085836172,\n", + " 0.02375585213303566,\n", + " -0.040130291134119034,\n", + " 0.020003633573651314,\n", + " -0.0029141209088265896,\n", + " 0.02585955522954464,\n", + " 0.0014155399985611439,\n", + " 0.029033564031124115,\n", + " 0.020790982991456985,\n", + " -0.002545050112530589,\n", + " -0.035553812980651855,\n", + " 0.012745242565870285,\n", + " 0.029230400919914246,\n", + " 0.01743244007229805,\n", + " 0.01534103974699974,\n", + " -0.032847292721271515,\n", + " 0.06864715367555618,\n", + " 0.005117780528962612,\n", + " 0.0252690427005291,\n", + " 0.05073492228984833,\n", + " 0.053539860993623734,\n", + " 0.0273850467056036,\n", + " 0.024051109328866005,\n", + " 0.013274244032800198,\n", + " 0.014492177404463291,\n", + " 0.054327208548784256,\n", + " 0.02107393741607666,\n", + " -0.0037768236361443996,\n", + " -0.03813730925321579,\n", + " 0.043181274086236954,\n", + " 0.07100920379161835,\n", + " 0.03127259388566017,\n", + " -0.025219833478331566,\n", + " 0.06229913607239723,\n", + " 0.05176832154393196,\n", + " -0.01765388250350952,\n", + " -0.014689014293253422,\n", + " 0.07189497351646423,\n", + " -0.02261173352599144,\n", + " 0.028418445959687233,\n", + " -0.0022005841601639986,\n", + " -0.01705106720328331,\n", + " 0.029451843351125717,\n", + " -0.00958353653550148,\n", + " -0.03742377087473869,\n", + " 0.014664409682154655,\n", + " -0.036291953176259995,\n", + " 0.035578418523073196,\n", + " 0.02050803042948246,\n", + " -0.04382099583745003,\n", + " 0.022464103996753693,\n", + " 0.06982818245887756,\n", + " -0.05486851558089256,\n", + " -0.03794046863913536,\n", + " 0.01301589421927929,\n", + " 0.05132543668150902,\n", + " 0.03466804325580597,\n", + " 0.03314255177974701,\n", + " -0.058952897787094116,\n", + " 0.042836807668209076,\n", + " 0.0406469888985157,\n", + " 0.03503711521625519,\n", + " 0.017949139699339867,\n", + " 0.04325508698821068,\n", + " -0.03577525541186333,\n", + " 0.05536060780286789,\n", + " 0.013864756561815739,\n", + " 0.023128431290388107,\n", + " 0.03196152299642563,\n", + " 0.04158196598291397,\n", + " -0.01034628227353096,\n", + " -0.029255006462335587,\n", + " 0.025810346007347107,\n", + " -0.01254840474575758,\n", + " -0.016632787883281708,\n", + " -0.016054576262831688,\n", + " -0.0040997606702148914,\n", + " -0.006661726627498865,\n", + " -0.011299715377390385,\n", + " -0.03624274581670761,\n", + " 0.06648194044828415,\n", + " 0.020963216200470924,\n", + " -0.01685423031449318,\n", + " 0.02263633720576763,\n", + " -0.04788077622652054,\n", + " -0.01860116422176361,\n", + " 0.007399867754429579,\n", + " 0.02645006775856018,\n", + " 0.04153275862336159,\n", + " 0.05964182689785957,\n", + " -0.019216282293200493,\n", + " 0.04367337003350258,\n", + " 0.01856425777077675,\n", + " 0.01802295260131359,\n", + " -0.011785658076405525,\n", + " 0.049529291689395905,\n", + " -0.051817528903484344,\n", + " -0.002729585627093911,\n", + " -0.05693531036376953,\n", + " 0.024580109864473343,\n", + " -0.015673203393816948,\n", + " 0.041877225041389465,\n", + " -0.060232341289520264,\n", + " -0.014910456724464893,\n", + " -0.0038752425462007523,\n", + " -0.01292977761477232,\n", + " -0.018638070672750473,\n", + " 0.014824341051280499,\n", + " 0.014775130897760391,\n", + " -0.05211278423666954,\n", + " 0.018478140234947205,\n", + " 0.049922965466976166,\n", + " -0.08459100872278214,\n", + " 0.03646418824791908,\n", + " 0.033634644001722336,\n", + " 0.03203533962368965,\n", + " -0.014381456188857555,\n", + " -0.015131899155676365,\n", + " -0.013052801601588726,\n", + " -0.01627601869404316,\n", + " -0.0674661248922348,\n", + " -0.014036989770829678,\n", + " -0.014123106375336647,\n", + " -0.004388866014778614,\n", + " 0.01591924950480461,\n", + " 0.09093902260065079,\n", + " -0.00393060315400362,\n", + " 0.03442199528217316,\n", + " -0.018342815339565277,\n", + " -0.023620525375008583,\n", + " 0.047216448932886124,\n", + " 0.01858886145055294,\n", + " -0.044165462255477905,\n", + " -0.0074429260566830635,\n", + " -0.019511539489030838,\n", + " 0.024063410237431526,\n", + " 0.031936921179294586,\n", + " 0.04313206300139427,\n", + " -0.058362383395433426,\n", + " -0.03159245476126671,\n", + " 0.048348262906074524,\n", + " -0.024580109864473343,\n", + " -0.054130371659994125,\n", + " -0.01956074871122837,\n", + " 0.008205672726035118,\n", + " 0.017912231385707855,\n", + " 0.036144327372312546,\n", + " 0.05157148092985153,\n", + " 0.0033462413121014833,\n", + " -0.03865400701761246,\n", + " 0.03587367385625839,\n", + " 0.023042315617203712,\n", + " -0.00723993731662631,\n", + " 0.015673203393816948,\n", + " -0.029255006462335587,\n", + " -0.005028588697314262,\n", + " 0.001956074731424451,\n", + " 0.04987375810742378,\n", + " -0.03661181405186653,\n", + " 0.04802840203046799,\n", + " -0.053146183490753174,\n", + " -0.0007781240856274962,\n", + " -0.0009580460609868169,\n", + " 0.018551954999566078,\n", + " 0.021037030965089798,\n", + " -0.015205713920295238,\n", + " 0.044780582189559937,\n", + " 0.015759319067001343,\n", + " 0.07420781999826431,\n", + " 0.034225158393383026,\n", + " -0.05142385512590408,\n", + " -0.04298443719744682,\n", + " 0.03215836361050606,\n", + " -0.06559617072343826,\n", + " 0.030386822298169136,\n", + " -0.06667877733707428,\n", + " 0.0344466008245945,\n", + " -0.04047475382685661,\n", + " 0.03769442439079285,\n", + " 0.018736490979790688,\n", + " 0.06092127412557602,\n", + " 0.04997217655181885,\n", + " -0.013335755094885826,\n", + " 0.05880526825785637,\n", + " 0.044879000633955,\n", + " 0.03865400701761246,\n", + " -0.0612657405436039,\n", + " -0.07440465688705444,\n", + " -0.028221607208251953,\n", + " 0.005529909394681454,\n", + " -0.039146099239587784,\n", + " 0.002680376172065735,\n", + " -0.03390529751777649,\n", + " 0.06515328586101532,\n", + " 0.04315666854381561,\n", + " 0.05309697613120079,\n", + " 0.015845436602830887,\n", + " -0.017334021627902985,\n", + " 0.04527267441153526,\n", + " -0.0034723402932286263,\n", + " -0.0035338520538061857,\n", + " 0.059494201093912125,\n", + " -0.039564382284879684,\n", + " 0.03887544944882393,\n", + " 0.0004594161582645029,\n", + " 0.04692118987441063,\n", + " 0.06923766434192657,\n", + " 0.03771902620792389,\n", + " -0.06372620910406113,\n", + " 0.027114395052194595,\n", + " 0.02991933375597,\n", + " -0.03774363175034523,\n", + " 0.04232010990381241,\n", + " 0.049553897231817245,\n", + " 0.018884118646383286,\n", + " 0.02242719754576683,\n", + " -0.05934657156467438,\n", + " -0.01721099764108658,\n", + " 0.01101676095277071,\n", + " -0.026523882523179054,\n", + " 0.019044049084186554,\n", + " 0.049160219728946686,\n", + " 0.04534648731350899,\n", + " -0.027262024581432343,\n", + " 0.037103909999132156,\n", + " 0.01225929893553257,\n", + " 0.022660942748188972,\n", + " 0.040130291134119034,\n", + " 0.009706559590995312,\n", + " -0.010887586511671543,\n", + " 0.00862395204603672,\n", + " 0.05383511632680893,\n", + " 0.03798967972397804,\n", + " -0.04748709872364998,\n", + " 0.07637303322553635,\n", + " -0.012302357703447342,\n", + " 0.05595112219452858,\n", + " 0.03525855764746666,\n", + " -0.014012385159730911,\n", + " 0.023140734061598778,\n", + " 0.014627503231167793,\n", + " 0.058903686702251434,\n", + " 0.0009672728483565152,\n", + " 0.048938777297735214,\n", + " 0.047019608318805695,\n", + " 0.044903602451086044,\n", + " 0.004038248676806688,\n", + " 0.04738868027925491,\n", + " -0.03319175913929939,\n", + " 0.006003550253808498,\n", + " 0.020778682082891464,\n", + " 0.06195467337965965,\n", + " 0.056787680834531784,\n", + " 0.015439458191394806,\n", + " -0.06854873150587082,\n", + " 0.01858886145055294,\n", + " -0.03449580818414688,\n", + " 0.03082970716059208,\n", + " 0.02491227351129055,\n", + " 0.052014365792274475,\n", + " 0.02028658799827099,\n", + " 0.03009156696498394,\n", + " -0.010573876090347767,\n", + " 0.0003846408799290657,\n", + " -0.0009334413916803896,\n", + " -0.03929372876882553,\n", + " 0.042812202125787735,\n", + " -0.015636296942830086,\n", + " -0.013532592914998531,\n", + " 0.03385608643293381,\n", + " -0.04778235778212547,\n", + " 0.09000404924154282,\n", + " 0.08316393196582794,\n", + " -0.030411427840590477,\n", + " 0.01568550616502762,\n", + " 0.03998266160488129,\n", + " 0.03282269090414047,\n", + " 0.03776823729276657,\n", + " -0.004105911590158939,\n", + " 0.05063650384545326,\n", + " -0.019019443541765213,\n", + " -0.04522346705198288,\n", + " -0.03811270371079445,\n", + " -0.015845436602830887,\n", + " 0.01836741901934147,\n", + " -0.0020529557950794697,\n", + " -0.028664492070674896,\n", + " 0.043771788477897644,\n", + " 0.003081740578636527,\n", + " 0.05944499000906944,\n", + " 0.018281303346157074,\n", + " 0.007055401802062988,\n", + " 0.013655616901814938,\n", + " -0.03968740627169609,\n", + " -0.01590694859623909,\n", + " 0.05344143882393837,\n", + " 0.06500565260648727,\n", + " -0.03734995797276497,\n", + " 0.0014024687698110938,\n", + " 0.014418362639844418,\n", + " -0.10043644905090332,\n", + " -0.022279569879174232,\n", + " -0.03454501926898956,\n", + " -0.02028658799827099,\n", + " 0.08882302045822144,\n", + " -0.033044133335351944,\n", + " 0.008008834905922413,\n", + " 0.05609874799847603,\n", + " -0.028073979541659355,\n", + " 0.026130206882953644,\n", + " 0.05329381301999092,\n", + " 0.02566271834075451,\n", + " -0.017789209261536598,\n", + " -0.04118829220533371,\n", + " -0.050685711205005646,\n", + " 0.01723560318350792,\n", + " -0.022082731127738953,\n", + " 0.01821979135274887,\n", + " 0.022119637578725815,\n", + " 0.030583661049604416,\n", + " -0.044903602451086044,\n", + " -0.0025758061092346907,\n", + " 0.08685464411973953,\n", + " 0.035922884941101074,\n", + " -0.002245180308818817,\n", + " -0.006397225894033909,\n", + " 0.01744474284350872,\n", + " 0.01504578348249197,\n", + " -0.018072163686156273,\n", + " 0.004228935111314058,\n", + " 0.03722693398594856,\n", + " 0.028418445959687233,\n", + " 0.020446518436074257,\n", + " 0.02910737693309784,\n", + " -0.05422879010438919,\n", + " 0.04421467334032059,\n", + " 0.018281303346157074,\n", + " -0.03338859602808952,\n", + " 0.11278801411390305,\n", + " -0.010733806528151035,\n", + " 0.028812121599912643,\n", + " 0.026671510189771652,\n", + " -0.0007773552206344903,\n", + " 0.002043729182332754,\n", + " -0.025982579216361046,\n", + " 0.00021548348013311625,\n", + " -0.01760467328131199,\n", + " -0.024112621322274208,\n", + " -0.04805300757288933,\n", + " 0.07420781999826431,\n", + " 0.05073492228984833,\n", + " -0.020631052553653717,\n", + " -0.03607051074504852,\n", + " -0.040720801800489426,\n", + " -0.0049516987055540085,\n", + " -0.007344507146626711,\n", + " 0.015956157818436623,\n", + " 0.02605639211833477,\n", + " -0.04733946919441223,\n", + " 0.055065352469682693,\n", + " 0.0321829654276371,\n", + " 0.044534534215927124,\n", + " -0.02013895846903324,\n", + " 0.04232010990381241,\n", + " -0.025367461144924164,\n", + " 0.007270693313330412,\n", + " 0.04113908112049103,\n", + " 0.01569780707359314,\n", + " 0.01648515835404396,\n", + " -0.04276299476623535,\n", + " 0.036833256483078,\n", + " 0.05442563071846962,\n", + " -0.05713214725255966,\n", + " 0.06151178851723671,\n", + " 0.007879659533500671,\n", + " -0.017789209261536598,\n", + " 0.12883028388023376,\n", + " 0.005434566177427769,\n", + " -0.07686512917280197,\n", + " 0.044165462255477905,\n", + " 0.05964182689785957,\n", + " 0.011201296001672745,\n", + " -0.01764157973229885,\n", + " 0.052555669099092484,\n", + " 0.010198654606938362,\n", + " 0.030755894258618355,\n", + " 0.015021177940070629,\n", + " -0.007098460104316473,\n", + " -0.018638070672750473,\n", + " -0.04507583752274513,\n", + " -0.008174916729331017,\n", + " -0.05752582475543022,\n", + " -0.02854146994650364,\n", + " 0.0437471829354763,\n", + " 0.0300669614225626,\n", + " -0.012437683530151844,\n", + " -0.036267347633838654,\n", + " 0.018269000574946404,\n", + " 0.030608264729380608,\n", + " -0.03872781991958618,\n", + " -0.03316715359687805,\n", + " -0.07317442446947098,\n", + " 0.03488948568701744,\n", + " -0.05235883221030235,\n", + " -0.04500202462077141,\n", + " 0.01798604615032673,\n", + " 0.0285168644040823,\n", + " 0.022759361192584038,\n", + " 0.045887794345617294,\n", + " -0.03085431270301342,\n", + " -0.02701597660779953,\n", + " -0.005951265338808298,\n", + " -0.028467655181884766,\n", + " -0.016177600249648094,\n", + " 0.024666227400302887,\n", + " -0.00689547136425972,\n", + " -0.0008165689650923014,\n", + " 0.05580349266529083,\n", + " 0.05073492228984833,\n", + " 0.06899161636829376,\n", + " 0.010899888351559639,\n", + " -0.0027526523917913437,\n", + " 0.020581843331456184,\n", + " 0.029820913448929787,\n", + " 0.025761136785149574,\n", + " 0.04957849904894829,\n", + " 0.015857739374041557,\n", + " -0.04886496439576149,\n", + " 0.01177950669080019,\n", + " 0.08001453429460526,\n", + " 0.036119721829891205,\n", + " 0.04232010990381241,\n", + " 0.0018884118180721998,\n", + " 0.04542030394077301,\n", + " -0.008956115692853928,\n", + " -0.031174173578619957,\n", + " 0.015094992704689503,\n", + " -0.03186310455203056,\n", + " 0.022451801225543022,\n", + " -0.0152426203712821,\n", + " -0.009940304793417454,\n", + " -0.04542030394077301,\n", + " 0.04775775223970413,\n", + " 0.04561714082956314,\n", + " -0.02184898592531681,\n", + " 0.056049540638923645,\n", + " 0.0455925352871418,\n", + " 0.034003715962171555,\n", + " 0.030928125604987144,\n", + " 0.025785740464925766,\n", + " -0.009097592905163765,\n", + " -0.039761219173669815,\n", + " 0.03107575513422489,\n", + " 0.010377038270235062,\n", + " -0.03530776500701904,\n", + " -7.82353017712012e-05,\n", + " -0.023435991257429123,\n", + " 0.01897023431956768,\n", + " -0.020963216200470924,\n", + " -0.027901746332645416,\n", + " -0.032109152525663376,\n", + " 0.0150334807112813,\n", + " -0.012966684997081757,\n", + " 0.018625769764184952,\n", + " 0.019413119181990623,\n", + " -0.025022994726896286,\n", + " 0.038407959043979645,\n", + " -0.012505345977842808,\n", + " -0.02219345234334469,\n", + " -0.004133591894060373,\n", + " 0.028098585084080696,\n", + " -0.027729513123631477,\n", + " -0.048176031559705734,\n", + " 0.03149403631687164,\n", + " 0.03356083109974861,\n", + " -0.0010126377455890179,\n", + " 0.045715559273958206,\n", + " 0.013188127428293228,\n", + " 0.008802336640655994,\n", + " -0.007781241089105606,\n", + " 0.017567766830325127,\n", + " 0.04286141321063042,\n", + " 0.026523882523179054,\n", + " 0.01285596378147602,\n", + " 0.05216199532151222,\n", + " -0.0268191397190094,\n", + " 0.028123188763856888,\n", + " 0.04802840203046799,\n", + " 0.07730801403522491,\n", + " 0.04113908112049103,\n", + " 0.00751674035564065,\n", + " 0.03562762588262558,\n", + " -0.022660942748188972,\n", + " 0.040327128022909164,\n", + " -0.030755894258618355,\n", + " 0.027311233803629875,\n", + " -0.0004398092860355973,\n", + " -0.008285637944936752,\n", + " 0.0660390555858612,\n", + " -0.022365685552358627,\n", + " 0.06569458544254303,\n", + " 0.021356891840696335,\n", + " -0.006938529666513205,\n", + " 0.012050159275531769,\n", + " 0.005489926785230637,\n", + " 0.0671708732843399,\n", + " -0.021504521369934082,\n", + " 0.054720886051654816,\n", + " 0.011545762419700623,\n", + " 0.056246377527713776,\n", + " 0.015439458191394806,\n", + " 0.016411345452070236,\n", + " 0.04192643240094185,\n", + " -0.014848945662379265,\n", + " 0.014602898620069027,\n", + " 0.032871898263692856,\n", + " -0.019388515502214432,\n", + " 0.033216364681720734,\n", + " 0.040302522480487823,\n", + " -0.021184658631682396,\n", + " 0.033216364681720734,\n", + " 0.04679816588759422,\n", + " -0.02991933375597,\n", + " 0.026696115732192993,\n", + " -0.026179416105151176,\n", + " -0.06229913607239723,\n", + " -0.01780151017010212,\n", + " -0.019007142633199692,\n", + " -0.03850637748837471,\n", + " -0.048766545951366425,\n", + " -0.07927639037370682,\n", + " 0.03277347981929779,\n", + " 0.056443214416503906,\n", + " -0.007233785931020975,\n", + " -0.04096684977412224,\n", + " -0.0075105889700353146,\n", + " -0.016952648758888245,\n", + " -0.03875242546200752,\n", + " 0.044780582189559937,\n", + " 0.018084464594721794,\n", + " -0.03262585029006004,\n", + " 0.0060373819433152676,\n", + " -0.0001253302616532892,\n", + " 0.011828716844320297,\n", + " 0.0031617057975381613,\n", + " 0.06761375814676285,\n", + " -0.004699500277638435,\n", + " 0.04389481246471405,\n", + " -0.008144160732626915,\n", + " 0.03543078899383545,\n", + " -0.012246997095644474,\n", + " -0.06771217286586761,\n", + " -0.023645130917429924,\n", + " 0.02301771007478237,\n", + " -0.017949139699339867,\n", + " 0.059100523591041565,\n", + " 0.0024481690488755703,\n", + " 0.01782611571252346,\n", + " 0.023829666897654533,\n", + " -0.01802295260131359,\n", + " 0.004837901797145605,\n", + " 0.04222169145941734,\n", + " -0.0256873220205307,\n", + " 0.0074429260566830635,\n", + " -0.012203938327729702,\n", + " 0.03774363175034523,\n", + " 0.05654163286089897,\n", + " -0.036882467567920685,\n", + " 0.03491409122943878,\n", + " 0.008205672726035118,\n", + " -0.03789126127958298\n", + " ]\n", + "]\n" + ] + } + ], + "source": [ + "from ibm_watsonx_ai import Credentials\n", + "from ibm_watsonx_ai.foundation_models import Embeddings\n", + "import json\n", + "\n", + "credentials = Credentials(\n", + " api_key = f\"{apikey}\", \n", + " url = f\"{watsonx_ai_url}\" \n", + ")\n", + "\n", + "embedding = Embeddings(\n", + " model_id= \"ibm/granite-embedding-278m-multilingual\",\n", + " credentials = credentials,\n", + " project_id = f\"{project_id}\"\n", + ")\n", + "\n", + "texts = [\n", + " \"Youth craves thrills while adulthood cherishes wisdom.\",\n", + " \"Youth seeks ambition while adulthood finds contentment.\",\n", + " \"Dreams chased in youth while goals pursued in adulthood.\"\n", + "]\n", + "\n", + "result = embedding.embed_documents( texts = texts ) \n", + "\n", + "print( json.dumps( result, indent=3 ) )\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}