Embedding Model API ํ•œ๊ตญ์–ด Token & ๋น„์šฉ ๋น„๊ต
ยท
๐Ÿ—ฃ๏ธ Natural Language Processing
“๋Œ€ํ•œ๋ฏผ๊ตญ ๋ฒ•๋ฅ  ์ „๋ฌธ”์„ ๊ฐ€์ง€๊ณ  OpenAI(ChatGPT), GOOGLE(Gemini), Antropic(Claude), Upstage(Solar)๋ฅผ ๋Œ€์ƒ์œผ๋กœ embedding ํ›„ token ์ˆ˜๋ฅผ ๋น„๊ตํ•˜๋Š” ์‹คํ—˜์„ ์ง„ํ–‰ Goal : API๋กœ ์ œ๊ณต๋˜๋Š” LLM ์ค‘ ์–ด๋–ค ๋ชจ๋ธ์ด ํ•œ๊ตญ์–ด token์„ ๊ฐ€์žฅ ์ ๊ฒŒ ์‚ฌ์šฉํ•˜๊ณ  ๋น„์šฉ ์ €๋ ดํ•œ์ง€ ๋น„๊ต Input Text(๋Œ€ํ•œ๋ฏผ๊ตญํ—Œ๋ฒ• ์ „๋ฌธ, text length=373) ์œ ๊ตฌํ•œ ์—ญ์‚ฌ์™€ ์ „ํ†ต์— ๋น›๋‚˜๋Š” ์šฐ๋ฆฌ๋“ค ๋Œ€ํ•œ๊ตญ๋ฏผ์€ ๊ธฐ๋ฏธ ์‚ผ์ผ์šด๋™์œผ๋กœ ๋Œ€ํ•œ๋ฏผ๊ตญ์„ ๊ฑด๋ฆฝํ•˜์—ฌ ์„ธ๊ณ„์— ์„ ํฌํ•œ ์œ„๋Œ€ํ•œ ๋…๋ฆฝ์ •์‹ ์„ ๊ณ„์Šนํ•˜์—ฌ ์ด์ œ ๋ฏผ์ฃผ๋…๋ฆฝ๊ตญ๊ฐ€๋ฅผ ์žฌ๊ฑดํ•จ์— ์žˆ์–ด์„œ ์ •์˜์ธ๋„์™€ ๋™ํฌ์• ๋กœ์จ ๋ฏผ์กฑ์˜ ๋‹จ๊ฒฐ์„ ๊ณต๊ณ ํžˆ ํ•˜๋ฉฐ ๋ชจ๋“  ์‚ฌํšŒ์  ํ์Šต์„ ํƒ€ํŒŒํ•˜๊ณ  ๋ฏผ์ฃผ์ฃผ์˜์ œ์ œ๋„๋ฅผ ์ˆ˜๋ฆฝํ•˜์—ฌ ์ •์น˜, ๊ฒฝ์ œ, ์‚ฌํšŒ, ๋ฌธํ™”์˜ ๋ชจ๋“  ์˜์—ญ์— ์žˆ์–ด..
[Gemini-pro] ๊ตฌ๊ธ€ ์žผ๋ฏธ๋‹ˆ Pro, beta ๋ฌด๋ฃŒ
ยท
๐Ÿ› ๏ธ Tools
Google Bard = Gemini - pro google gemini ๋ผ์ธ์—…(2023.12.6)์ด ๊ณต๊ฐœ๋œ์ง€ ๋ฒŒ์จ 2๋‹ฌ์ด ๋„˜์–ด๊ฐ€์ง€๋งŒ API๋ฉฐ ์‚ฌ์šฉ์ž๋ฅผ ์ฐพ๊ธฐ ์–ด๋ ต๋‹ค. ๊ทธ๋งŒํผ OpenAI, Open source LLM์ด ์‚ฌ๋žŒ๋“ค์˜ ๊ด€์‹ฌ์ด ์ ๋ ค ์žˆ๋Š”๋ฐ Gemini-pro, ๊ทธ๊ฒƒ๋„ GPT-3 ํ˜น์€ GPT-3.5์— ์ค€ํ•˜๋Š” ๋ชจ๋ธ์ด ๋ฌด๋ฃŒ API๋กœ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•œ๋ฐ ์•ˆ ์“ธ ์ด์œ ๊ฐ€ ์—†๋‹ค. (๋‹จ, ๋ฐ์ดํ„ฐ ํ•™์Šต ์žฌ์‚ฌ์šฉ ํ—ˆ์šฉ) ์ œ๊ณต API Spec. https://ai.google.dev/models/gemini?hl=ko Gemini ๋ชจ๋ธ | Google AI for Developers ์ด ํŽ˜์ด์ง€๋Š” Cloud Translation API๋ฅผ ํ†ตํ•ด ๋ฒˆ์—ญ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์˜๊ฒฌ ๋ณด๋‚ด๊ธฐ Gemini ๋ชจ๋ธ ์ปฌ๋ ‰์…˜์„ ์‚ฌ์šฉํ•ด ์ •๋ฆฌํ•˜๊ธฐ ๋‚ด ํ™˜..
[OpenAI API] OpenAI Token
ยท
๐Ÿ—ฃ๏ธ Natural Language Processing
https://github.com/seohyunjun/openAI_API_token GitHub - seohyunjun/openAI_API_token: openAI API token information openAI API token information. Contribute to seohyunjun/openAI_API_token development by creating an account on GitHub. github.com
[LangChain] No using OpenAI API RetrievalQA
ยท
๐Ÿ—ฃ๏ธ Natural Language Processing
LangChain No using OpenAI API (1) QA๋ฅผ ์œ„ํ•œ Document ๋ถˆ๋Ÿฌ์˜ค๊ธฐ # Load and process the text files # loader = TextLoader("./data/texts") loader = DirectoryLoader('./pdf/', glob="./*.pdf", loader_cls=PyPDFLoader) documents = loader.load() # Document ๋ถ„์ ˆ text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200) texts = text_splitter.split_documents(documents) (2) Embedding # HuggingF..
[OpenAI-GPT] LangChain ํšจ์œจ์ ์ธ Token ๊ด€๋ฆฌ
ยท
๐Ÿ› ๏ธ Tools/๐Ÿค– ChatGPT
LLM + Chain Tool Welcome to LangChain — ๐Ÿฆœ๐Ÿ”— LangChain 0.0.175 python.langchain.com ์ตœ๊ทผ LangChain์„ ํ†ตํ•œ GPT ์„œ๋“œํŒŒํ‹ฐ ํˆด์ด ์Ÿ์•„์ง€๊ณ  ์žˆ๋‹ค. LLM ๋ชจ๋ธ์„ ํ™œ์šฉํ•ด ์ž๋™์œผ๋กœ Tool์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋งŒ๋“ค์–ด ์ฃผ๊ณ  ์žˆ๋‹ค. ๊ทธ ๊ฒฐ๊ณผ ์‹ค์ œ๋กœ ์›ํ•˜๋Š” ์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ - Auto-GPT https://youtu.be/gWy-pJ2ofEM?si=f3pADRKEIZMsdhB2 Q&A ์ง€์‹ ๊ธฐ๋ฐ˜ ๊ฒ€์ƒ‰ Bot ๋งŒ๋“ค๊ธฐ https://youtu.be/cFCGUjc33aU?si=s7m0nw4MjKzaoQII ๋‹ค์–‘ํ•œ ์„œ๋น„์Šค๊ฐ€ LLM ๋ชจ๋ธ์„ ํ†ตํ•ด ๊ฐœ๋ฐœ๋˜๊ณ  ์žˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์šฐ๋ฆฌ๊ฐ€ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ฆฌ์†Œ์Šค๋กœ๋Š” Meta์—์„œ ๋ฐœํ‘œํ•œ LLAMA ๋ชจ๋ธ์ด๋‚˜ Open์†Œ์Šค๋กœ ๊ณต๊ฐœํ•œ data..
๋‹คํ–ˆ๋‹ค
'API' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก