초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
바로 이전 강의에서 01번 파일에서 쓰던 terminal 말고 새로 터미널을 생성해서 해야 하나요? 새로 new terminal을 생성했을 때 코드 앞부분에 (ch02_env) 가 안뜨는데 그러면 가상환경을 다시 활성화 해야하는건가요? 같은 폴더 안이라도 매 파일마다 터미널을 새로 생성해야하는건지 아니면 한번 가상환경을 생성하고 활성화 했으면 그걸로 쭉 써도 되는지 가상환경 개념이 헷갈립니다ㅜㅜ
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요. 강의 자료에는 따로 완성된 코드를 볼 수 있는 자료가 없던데 제공되지 않는건가요?
VS 세팅에 문제가 있는제.. CMD 창에서 code . 해도 안열려요.. 어떻게 해야하나요? 1. 경로문제 환경설정변경에 path 에 들어가서 poetry 경로로 변경했지만 안됨 VS 를 재다운로드받아서 실행하면서 (path 변경) 했지만 안됨 관리자권한으로 경로를 지정해서 수동으로 했지만 안됨 VS 파일열기로 들어감 그렇게 해도 실행이 안됨... 왜 그렇죠?
초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
response = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Tell me how to make a pizza"}]) --------------------------------------------------------------------------- APIRemovedInV1 Traceback (most recent call last) Cell In[16], line 1 ----> 1 response = openai.ChatCompletion.create( 2 model ="gpt-3.5-turbo", 3 messages =[{"role": "user", "content": "Tell me how to make a pizza"}]) File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/openai/lib/_old_api.py:39 , in APIRemovedInV1Proxy.__call__ (self, args, * kwargs) 38 def call (self, args: Any, * kwargs: Any) -> Any: ---> 39 raise APIRemovedInV1(symbol=self._symbol) APIRemovedInV1 : You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API. You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface. Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28 A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742
안녕하세요. 강의 Gradio ChatInterface로 PDF 챗봇 애플리케이션 구현 (실습) 에서 additional inputs 에서 pdf 로딩하고, chunk size, chunk overlap, similarity metric, temperature 까지 해놓고 쿼리로 'what is the attention mechanism in transformers?' 라고 하니 대답으로 ' Error in loading PDF or creating vectorstore' 가 나옵니다. dependencies 는 아래와 같습니다. [tool.poetry.dependencies] python = "^3.12" chromadb = "^0.5.3" python-dotenv = "^1.0.1" langchain = "^0.2.5" langchain-openai = "^0.1.8" langchain-community = "^0.2.5" pypdf = "^4.2.0" gradio = "^4.36.1" gradio-pdf = "^0.0.11" langchain-text-splitters = "^0.2.1" 무엇이 문제일까용??
학습 관련 질문이 있으시면, 상세하게 남겨주세요.문제가 발생한 부분의 코드를 함께 올려주세요.수업 영상 몇 분/초 구간인지 알려주세요. 섹션1-3번째 강의 16분쯤에서 llm.invoke(prompt_text) 이 코드 작성부터 RateLimitError Traceback (most recent call last) Cell In[17], line 1 ----> 1 llm.invoke(prompt_text) File c:\Users\lhm22\AppData\Local\pypoetry\Cache\virtualenvs\qa-bot-nop3jHt_-py3.9\lib\site-packages\langchain_core\language_models\chat_models.py:170 , in BaseChatModel.invoke (self, input, config, stop, kwargs) 159 def invoke( 160 self, 161 input: LanguageModelInput, (...) 165 kwargs: Any, 166 ) -> BaseMessage: 167 config = ensure_config(config) 168 return cast( 169 ChatGeneration, --> 170 self.generate_prompt( 171 [self._convert_input(input)], 172 stop=stop, 173 callbacks=config.get("callbacks"), 174 tags=config.get("tags"), 175 metadata=config.get("metadata"), 176 run_name=config.get("run_name"), 177 run_id=config.pop("run_id", None), 178 **kwargs, 179 ).generations[0][0],... (...) 1027 stream_cls=stream_cls, 1028 ) RateLimitError : Error code: 429 - {'error': {'message': '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 .', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}} Output is truncated. View as a scrollable element or open in a text editor . Adjust cell output settings ... 이런 에러가 발생하네요.. 혹시 어떻게 해결할 수 있을까요?
구글링을 통해 pip upgrade, scipy==1.12.0 버전설치 vscode vswhere.exe 설치등을 해 보았는데 해결이 안되어 문의드립니다. (desktop_venv) D:\voicechat\DESKTOP>pip install scipy WARNING: Ignoring invalid distribution - (d:\voicechat\desktop\desktop_venv\lib\site-packages) WARNING: Ignoring invalid distribution -ip (d:\voicechat\desktop\desktop_venv\lib\site-packages) Collecting scipy Using cached scipy-1.13.1.tar.gz (57.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output] + meson setup C:\Users\joon\AppData\Local\Temp\pip-install-uhszo9tp\scipy_fd7942d271b54ed8b7897408b2e63822 C:\Users\joon\AppData\Local\Temp\pip-install-uhszo9tp\scipy_fd7942d271b54ed8b7897408b2e63822\.mesonpy-_ppx3dkm -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\joon\AppData\Local\Temp\pip-install-uhszo9tp\scipy_fd7942d271b54ed8b7897408b2e63822\.mesonpy-_ppx3dkm\meson-python-native-file.ini The Meson build system Version: 1.4.1 Source dir: C:\Users\joon\AppData\Local\Temp\pip-install-uhszo9tp\scipy_fd7942d271b54ed8b7897408b2e63822 Build dir: C:\Users\joon\AppData\Local\Temp\pip-install-uhszo9tp\scipy_fd7942d271b54ed8b7897408b2e63822\.mesonpy-_ppx3dkm Build type: native build Project name: scipy Project version: 1.13.1 WARNING: Failed to activate VS environment: Could not parse vswhere.exe output ..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']] The following exception(s) were encountered: Running icl "" gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" Running cl /? gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" Running cc --version gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" Running gcc --version gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" Running clang --version gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" Running clang-cl /? gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" Running pgcc --version gave "[WinError 2] 지정된 파일을 찾을 수 없습니다" A full log can be found at C:\Users\joon\AppData\Local\Temp\pip-install-uhszo9tp\scipy_fd7942d271b54ed8b7897408b2e63822\.mesonpy-_ppx3dkm\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
초보자를 위한 ChatGPT API 활용법 - API 기본 문법부터 12가지 프로그램 제작 배포까지
ch02_env 가상환경에서 2 + 2 셀의 실행 버튼을 누른 뒤 설치를 진행하였을때 발생한 에러입니다! vscode랑 python을 삭제하고 재설치 하였는데도 여전히 문제가 발생되었습니다 pip install requests 명령어를 사용하여 다른 패키지를 설치 하려고 했을 때도 문제가 발생하였습니다 해결 방법을 알려주시면 감사하겠습니다!
학Chroma DB를 활용하여 PDF 파일에 대해 RAG 기반 질의응답 구현 (실습)의 29:00 에 있는 코드를 똑같이 실행했는데, 다음과 같은 에러가 발생했습니다. from langchain_openai import ChatOpenAI from langchain.chains.combine_documents import create_stuff_documents_chain from langchain.chains import create_retrieval_chain model = ChatOpenAI(model ='gpt-3.5-turbo-0125', temperature=0, api_key=OPENAI_API_KEY) document_chain = create_retrieval_chain(model, prompt) retrieval_chain = create_retrieval_chain(retriever, document_chain) response = retrieval_chain.invoke({"input": "what is the attention mechanism in transformers?"}) 에러 메시지 Cell In[163], line 1 ----> 1 response = retrieval_chain.invoke({"input": "what is the attention mechanism in transformers?"}) 2 print(response) ValueError: Invalid input type <class 'dict'>. Must be a PromptValue, str, or list of BaseMessages. Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...