๋ณธ๋ฌธ

[์‹ค์Šต] ๋žญ์ฒด์ธ(LangChain) HuggingFace Embedding ์˜ˆ์ œ

๋ฐ˜์‘ํ˜•

โœ…  ์‹ค์Šต ์ค€๋น„๋ฌผ: apikey

https://server-engineer.tistory.com/983

 

[์‹ค์Šต] OpenAI apikey ๋ฐœ๊ธ‰ ๋ฐ ์‚ฌ์šฉํ•˜๊ธฐ

1. ํšŒ์›๊ฐ€์ž…ํ•˜๊ธฐ ๋จผ์ € OpenAI ํ”Œ๋žซํผ์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค. (๋ฐ”๋กœ๊ฐ€๊ธฐ) ํ™ˆํŽ˜์ด์ง€์—์„œ ํšŒ์›๊ฐ€์ž… ์ ˆ์ฐจ๋ฅผ ์™„๋ฃŒํ•ด์ฃผ์„ธ์š”. 2. API ํ‚ค ๋ฐœ๊ธ‰ ๋ฐ›๊ธฐ ๋กœ๊ทธ์ธ ํ›„, ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์— ์žˆ๋Š” 'View API Keys'๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ์ง์ ‘ ๋ง

server-engineer.tistory.com


 

โœ…  ์‹ค์Šต ์ž๋ฃŒ

https://colab.research.google.com/github/i-am-shuan/learn-langchain/blob/main/langchain_huggingface_embedding_example.ipynb#scrollTo=4hniXcElvMif

 

langchain_huggingface_embedding_example.ipynb

Run, share, and edit Python notebooks

colab.research.google.com

 

โœ…  ์„œ๋น„์Šค ์„ค๋ช…

์งˆ๋ฌธ-๋‹ต๋ณ€ ๊ณผ์ •

  1. ์‚ฌ์šฉ์ž๊ฐ€ ์งˆ๋ฌธ์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  2. ์งˆ๋ฌธ์ด ๋ฐ์ดํ„ฐ ๋ฐฑํ„ฐํ™”๋˜์–ด ๋ฐฑํ„ฐ์Šคํ† ์–ด์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.
  3. ๋ฐฑํ„ฐ์Šคํ† ์–ด์—์„œ ์œ ์‚ฌํ•œ ๋‹ต๋ณ€์ด ๊ฒ€์ƒ‰๋ฉ๋‹ˆ๋‹ค.
  4. LLM(Large Language Model)์„ ์ด์šฉํ•ด์„œ ๋‹ต๋ณ€์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.
  5. ์ƒ์„ฑ๋œ ๋‹ต๋ณ€์ด ์‚ฌ์šฉ์ž์—๊ฒŒ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค.

 

์‚ฌ์šฉ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

  • openai: LLM์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.
  • numpy: ๋ฐ์ดํ„ฐ ๋ฐฑํ„ฐํ™”๋ฅผ ์œ„ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.
  • langchain: ๋ฐฑํ„ฐ์Šคํ† ์–ด์™€ LLM์„ ์—ฐ๊ฒฐํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.
  • vectorstore: ๋ฐฑํ„ฐ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ณ  ๊ฒ€์ƒ‰ํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.

 

๋ฐ˜์‘ํ˜•

๊ณต์œ 

๋Œ“๊ธ€