모두를 위한 ChatGPT Part 1 - ChatGPT를 이용한 업무자동화와 파이썬 입문
안녕하세요. 강의 듣다 궁금한 게 있어 질문 드립니다. 각 chapter에서 특정 파이썬 라이브러리를 사용하시는데, 저 같은 파이썬 초보자는 강의 외 자동화하고 싶은 업무가 있는 경우 어떻게 적합한 파이썬 라이브러리를 찾을 수 있을까요? 이것도 gpt한테 물어보는 게 좋을까요, 아니면 다른 팁이 있을까요? 감사합니다.
3-1.py 를 실행하면 제목과 같이 pykrx가 없다고 나옵니다. 앞의 게시물들을 참고하여 anaconda prompt에서 pandas==2.03 으로 설치하고 matplotlib 도 설치했습니다. pip list --version 을 해서 보면 아래와 같이 설치되어 있는 것 같습니다. pykrx 1.0.48 python >>> from pykrx import stock >>> stock.get_market_ohlcv_by_date("2023-01-01", "2023-01-31", "005930") 이걸로 실행해보면 결과가 잘 나옵니다. 이것도 정상적으로 나옵니다. 그런데 3-1.py를 실행하면 pykrx가 없다고 나옵니다. 도움을 부탁드립니다.
맥환경에서 아래와 같은 오류가 발생합니다. 그래서 pyarrow=="17.0.0"으로 내려서 설치하면 설치는 되는데 main.py 실행시 런타임 오류가 납니다. Terminal에는 output이 있네 그라지오에는 에러라고 나오는 등 poetry install명령을 치면 아래과 같은 설치오류 발생 (CrewAI 설치시) -- Configuring incomplete, errors occurred! error: command '/Library/Frameworks/Python.framework/Versions/3.12/bin/cmake' failed with exit code 1 at ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/ chef.py: 164 in _prepare 160│ 161│ error = ChefBuildError( "\n\n" .join(message_parts)) 162│ 163│ if error is not None : → 164 │ raise error from None 165│ 166│ return path 167│ 168│ def prepare sdist( self , archive: Path, destination: Path | None = None ) -> Path: Note: This error originates from the build backend, and is likely not a problem with poetry but with pyarrow (18.0.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pyarrow (==18.0.0)"'. 의존성에 문제가 있는 것 같습니다. 어떻게 해결해야 할까요?
모두를 위한 대규모 언어 모델 LLM(Large Language Model) Part 2 - 랭체인(LangChain)으로 나만의 ChatGPT 만들기
안녕하세요 OpenAI 를 활용해 llm 을 생성할 경우에는 with_structured_output 을 사용할 수 있는데요 llm = ChatOpenAI(model="gpt-3.5-turbo-0125", temperature=0, openai_api_key=OPENAI_KEY) structured_llm = llm.with_structured_output(TutorialSearch) query_analyzer = prompt | structured_llm 혹시 Llma3 모델에서도 with_structured_output 를 사용할 수 있나요? 프롬프트 관련 동영상 예제에서는 거의 ChatOpenAI 를 활용하시는것 같아서요 .. 강의 재미있게 잘 듣고 있습니다 감사합니다
초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
수업한 것을 보고 새롭게 만들었어요! 근데 사이트에서 자꾸 이게 떠요 RateLimitError : You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors . Traceback: File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling result = func() File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\streamlit\runtime\scriptrunner\script_ runner.py ", line 579, in code_to_exec exec(code, module.__dict__) File "C:\Users\a0108\OneDrive\바탕 화면\creative\ creative.py ", line 76, in <module> main() File "C:\Users\a0108\OneDrive\바탕 화면\creative\ creative.py ", line 48, in main st.info (askGpt_mart(prompt)) File "C:\Users\a0108\OneDrive\바탕 화면\creative\ creative.py ", line 6, in askGpt_mart response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_resources\chat_ completion.py ", line 25, in create return super().create(*args, **kwargs) File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_resources\abstract\engine_api_ resource.py ", line 153, in create response, _, api_key = requestor.request( File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_ requestor.py ", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_ requestor.py ", line 700, in _interpret_response self._interpret_response_line( File "C:\Users\a0108\OneDrive\바탕 화면\creative\creative_env\lib\site-packages\openai\api_ requestor.py ", line 765, in _interpret_response_line raise self.handle_error_response( 코드는 이렇게 짜여 있어요! import openai import streamlit as st def askGpt_mart(prompt): messages_prompt = [{"role": "system", "content": "친절하고 과학에 대해 깊게 알고 있는 다정한 과학자야. 그래서 답변할 때 다정하고 구체적으로 답변하고 단어가 어려우면 단어의 대체언어도 같이 나태내줘"},{"role":"user","content": f"{prompt}에 대한 실험 도구와 재료를 알려줘"}] response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def askGpt_method(prompt): messages_prompt = [{"role": "system", "content": "너는 똑똑하고 친절한 과학자야. 그래서 실험 방법을 구체적으로 쉽게 설명해주고 어려운 단어는 쓰지 않아."},{"role":"user","content": f"{prompt}에 대한 실험 방법을 알려줘"}] response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def askGpt_dev(prompt,prompt1,prompt2,prompt3): messages_prompt = [{"role": "system", "content": "너는 똑똑하고 친절하고 섬세한 과학자야. 원래 실험 방법에서 사용자의 환경을 고려하여 적절하게 실험 방법을 바꿔서 구체적이고 세세하게 알려주는 과학자야."},{"role":"user","content": f"나는 {prompt}에 대한 실험을 할거야. 하지만 나는 {prompt1}이 없어. 그래서 {prompt1}은 쓰지 못해. {prompt1}을 사용하는 실험 방법을 바꾸되 성공하게 하는 실험 방법을 알려줘 나는 {prompt2}에서 실험을 진행할 거야. 상황과 환경에 맞는 실험 방법을 부탁해. 또 {prompt3}(이)라는 추가적인 환경과 조건이 있으니까 이 모두를 적절히 고려해서 완전히 구체적이고 세부적이고 자세한 실험 방법을 알려줘" }] response = openai.ChatCompletion.create(model='gpt-4o-mini', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def askGpt(prompt): messages_prompt = [{"role": "system", "content": "너는 청자가 이 실험을 처음 하는 사람인 것을 알아서 이 실험이 실패할 수 있는 일을 구체적이고 자세하게 설명하면서 그러지 않기 위해서 어떻게 해야하는지 답하는 과학자야"},{"role" : "user", "content":f"{prompt}에 대한 실험 주의사항을 구체적으로 알려줘"}] response = openai.ChatCompletion.create(model='gpt-3.5-turbo', messages=messages_prompt) gptResponse = response["choices"][0]["message"]["content"] return gptResponse def main(): with st.sidebar: # Open AI API 키 입력받기 open_apikey = st.text_input(label='OPENAI API 키', placeholder='Enter Your API Key', value='',type='password') # 입력받은 API 키 표시 if open_apikey: openai.api_key = open_apikey st.markdown('---') st.header("AI 실험 도우미 ⚗️") st.markdown("---") ex_name = st.text_input("실험 이름",placeholder="거울 구리 실험, 나트륨 폭발 실험, 코끼리 실험...") co1,co2 = st.columns(2) with co1: if st.button("실험 도구 및 재료 안내"): prompt = ex_name st.info(askGpt_mart(prompt)) with co2: if st.button("실험 방법 안내"): prompt = ex_name st.info(askGpt_method(prompt)) st.markdown("===") col1,col2,col3 = st.columns(3) with col1: no_mar = st.text_input("없는 준비물",placeholder="유리막대, 비이커, 전자현미경...") with col2: where = st.text_input("장소",placeholder="집, 학교 실험실, 대학 생명과학 실험실...") with col3: add = st.text_input("추가 정보",placeholder="습도를 바꾸지 못함, 기온이 20도 이상으로 올라가지 않음...") if st.button("AI 실험 도우미"): prompt,prompt1,prompt2,prompt3 = ex_name,no_mar,where,add st.info(askGpt_dev(prompt,prompt1,prompt2,prompt3)) if st.button("주의사항"): prompt = ex_name st.info(askGpt(prompt)) if __name__=='__main__': main()
모두를 위한 대규모 언어 모델 LLM(Large Language Model) Part 1 - Llama 2 Fine-Tuning 해보기
안녕하세요 수업노트의 코드를 실행했을때 Assistant's Response message value 에서 중간 풀이 과정이 출력되지 않는데 동영상과 차이가 뭘까요? ㅇ 동영상 Value = "I need to solve the equation 3x + 11 = 14 . Can you help me?" Value = "Sure, Jane Doe! To solve the eqation 3x + 11 = 14 for x, We need to isolate x on the one side of eqation. Here's how we can do it step by step. Subtract 11 from both sides of the eqation to get '3x' by itself on one side. That leaves us with '3x = 14 - 11' Simplify the right side of equation to find out what '3x' equation. Divide both sides of the equation by 3 to solve for 'x' Let's do the calculation" Value = "The solution to the equation '3x + 11 = 14' is x = 1" ㅇ 실습코드 value='The solution to the equation \\(3x + 11 = 14\\) is \\(x = 1\\).') 'I need to solve the equation 3x + 11 = 14 . Can you help me?'