<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>meta Archives - JIN&#039;s BOT</title>
	<atom:link href="https://jinsbot.com/tag/meta/feed/" rel="self" type="application/rss+xml" />
	<link>https://jinsbot.com/tag/meta/</link>
	<description>Coding + Engineering</description>
	<lastBuildDate>Sun, 22 Sep 2024 11:16:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
<site xmlns="com-wordpress:feed-additions:1">158124120</site>	<item>
		<title>GPT3.5 Turbo – ChatGPT python API 소개</title>
		<link>https://jinsbot.com/gpt3-5-turbo/</link>
					<comments>https://jinsbot.com/gpt3-5-turbo/#respond</comments>
		
		<dc:creator><![CDATA[geniuskpj]]></dc:creator>
		<pubDate>Thu, 02 Mar 2023 09:38:48 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[GPT]]></category>
		<category><![CDATA[GPT3.5]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[openAI]]></category>
		<category><![CDATA[PYTHON]]></category>
		<category><![CDATA[Turbo]]></category>
		<guid isPermaLink="false">https://jinsbot.com/?p=877</guid>

					<description><![CDATA[<p>이전글에서 GPT3.5 모델의 python 사용법에 대해 소개했다. 그리고 ChatGPT 의 모델인 GPT3.5 Turbo 가 드디어 공개되었다. 이에 따라 변경된 python 사용법, 특징에 대해 소개하겠다. GPT3.5 Turbo python 코드 openai 패키지를 설치하거나 업데이트 후에 다음과 같이 사용한다. import openai openai.api_key ="발급받은 API키" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Tell the world about the ChatGPT API [&#8230;]</p>
<p>The post <a href="https://jinsbot.com/gpt3-5-turbo/">GPT3.5 Turbo – ChatGPT python API 소개</a> appeared first on <a href="https://jinsbot.com">JIN&#039;s BOT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://jinsbot.com/gpt-3-5-python/" target="_blank" rel="noreferrer noopener">이전글</a>에서 GPT3.5 모델의 python 사용법에 대해 소개했다.</p>
<p>그리고 ChatGPT 의 모델인 GPT3.5 Turbo 가 드디어 <a href="https://openai.com/blog/introducing-chatgpt-and-whisper-apis" target="_blank" rel="noreferrer noopener">공개</a>되었다.</p>
<p>이에 따라 변경된 python 사용법, 특징에 대해 소개하겠다.</p>
<h2 class="wp-block-heading">GPT3.5 Turbo python 코드</h2>
<p>openai 패키지를 설치하거나 업데이트 후에</p>
<p>다음과 같이 사용한다.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import openai
openai.api_key ="발급받은 API키"
completion = openai.ChatCompletion.create(
  model="gpt-3.5-turbo", 
  messages=[{"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."}]
)
print(completion)</pre>
<p>기존 Completion 에서 ChatCompletion 으로 바뀌었고</p>
<p>model이 gpt-3.5-turbo 로 바뀌었다.</p>
<p>마지막으로 prompt 가 messages로 바뀌었고</p>
<p>role이라는 인자가 추가되었다.</p>
<p>자세한 내용은 custom API 로 추가 설명하겠다.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">import requests
import json
headers={"Authorization":"Bearer 발급키","Content-Type":"application/json"}
link="https://api.openai.com/v1/chat/completions"
messages=[        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who won the world series in 2020?"},
        {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
        {"role": "user", "content": "Where was it played?"}]
data={"model": "gpt-3.5-turbo", "messages": messages, "temperature": 0.2, "max_tokens": 300}
res=requests.post(link,data=json.dumps(data),headers=headers)
print(res.json()['choices'][0]['message'])</pre>
<p>위 예제에서 볼 수 있듯이 이제 message를 복수개 보낼 수 있다.</p>
<p>system을 통해 GPT의 역할을 지정하는 것이고</p>
<p>user 는 사용자의 입력을 나타낸다.</p>
<p>마지막으로 assistant 는 이전 대답 혹은 사전 정보 를 의미한다.</p>
<p>나머지 parameter 는 이전과 동일하니 <a href="https://jinsbot.com/gpt-3-5-python/" target="_blank" rel="noreferrer noopener">이전글 </a>혹은</p>
<p><a href="https://platform.openai.com/docs/api-reference/chat/create" target="_blank" rel="noreferrer noopener">링크</a>를 확인하길 바란다.</p>
<h2 class="wp-block-heading">GPT3.5 용도</h2>
<p>openai 에서는 <a href="https://platform.openai.com/docs/guides/chat" target="_blank" rel="noreferrer noopener">가이드</a>를 통해 다음과 같은 사용을 추천하고 있다.</p>
<ul>
<li>이메일 이나 문서의 초안 작성</li>
<li>파이썬 코드 작성</li>
<li>문서에 담긴 정보에 대해 질의 응답</li>
<li>챗봇 생성</li>
<li>소프트웨어 자연어 인터페이스 추가</li>
<li>다양한 주제에 대한 tutor</li>
<li>번역</li>
<li>Simulate characters for video games and much more</li>
</ul>
<p>번역에 대해서는 다음과 같이 message를 작성하면 된다.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">text='텍스트'
messages=[{"role": "user", "content": f'Translate the following English text to Korean: {text}'}]</pre>
<h2 class="wp-block-heading">이전 모델과 차이가 뭐야?</h2>
<p>가격이 1/10 수준으로 <strong>저렴해졌다.</strong></p>
<p>기존 GPT3.5 모델은 1000토큰 당 0.02$이었지만</p>
<p>GPT3.5 Turbo는 1000토큰 당 0.002$이다.</p>
<p>그리고 추가 학습 ( fine tuning ) 에 대한</p>
<p>API는 아직 공개되지 않았다. ( 23.03.01 기준)</p>
<p>따라서 <strong>커스텀 모델</strong>이 필요한 경우에는</p>
<p>기존 모델을 사용해야 한다.</p>
<p>그리고 GPT3.5 Turbo 에 입력된 데이터는</p>
<p>30일간 저장된다고 명시 되었다.</p>
<p>데이터 사용에 대한 정책은 다음 <a href="https://platform.openai.com/docs/data-usage-policies" target="_blank" rel="noreferrer noopener">링크</a>를 참조하라.</p>
<p>개인 정보를 입력했을 경우 삭제 요청을 할 수 있다.</p>
<p>또, 차별 및 성희롱에 대한 판단 기능을</p>
<p>추가적으로 사용할 수 있으니 다음 <a href="https://platform.openai.com/docs/data-usage-policies" target="_blank" rel="noreferrer noopener">가이드</a>를 참고하라.</p>
<p>이외에도 음성 텍스트 변환 및 번역 모델인</p>
<p>Whisper 모델이 개선되었다.</p>
<p>개선 모델의 사용료는 분당 0.006$로 굉장히 저렴하고</p>
<p>다양한 언어와 포맷을 지원한다.</p>
<p>자세한 내용은 다음 <a href="https://platform.openai.com/docs/guides/speech-to-text" target="_blank" rel="noreferrer noopener">링크</a>에서 확인할 수 있다.</p>
<h2 class="wp-block-heading">GPT3.5 의 경쟁자는?</h2>
<p><a href="https://jinsbot.com/chatgpt-alternative/" target="_blank" rel="noreferrer noopener">다른 글</a>에서 meta ( facebook ) 의 OPT 모델에 대한 이야기를 했다.</p>
<p>meta 에서도 최근 새로운 모델인 LLaMA 를 제시했다.</p>
<p>가장 큰 모델이 65B 라 실망할 수도 있지만</p>
<p>학습 방법의 개선으로 성능은 이전 모델보다 뛰어나다고 한다.</p>
<p><a href="https://arxiv.org/abs/2302.13971" target="_blank" rel="noreferrer noopener">논문</a>에 따르면 GPT3 (구모델) 보다 나은 성능을 보인다.</p>
<p>성능 대비 요구 Parameter 가 줄었기 때문에 일부 모델은</p>
<p>3090, 3090S로 구동할 수 있을 것이다.</p>
<p>예를 들어 7B 모델은 max_batch_size를 1로 조정하면</p>
<p>16G VRAM으로 구동 가능하다.</p>
<p>fp8로 정밀도를 희생한다면 13B모델까지</p>
<p>3090에서 구동 가능할 것으로 예상된다.</p>
<p>참고로 LLaMa 의 상업적 사용은 별도의 협의가 필요하다.</p>
<p>아직 GPT3.5 수준에 이르지는 못했지만 둘의 경쟁으로</p>
<p>더 저렴하고 좋은 서비스가 나올 수 있을 것이다.</p>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<p>(23.03.06 updated)</p>
<p>흥미롭게도 LLaMa의 모델이 인터넷상에 유출되었다.</p>
<p>원래도 학술 목적으로는 어렵지 않게 받을 수 있었지만</p>
<p>일반인에게까지 오픈되어 사람들이 열심히 연구중이다.</p>
<p>흥미롭게도 누군가 LLaMa github 에 토렌트 ( 마그넷 ) 주소를</p>
<p>업로드 했으며 Meta에서도 딱히 삭제하지 않고 있다. (<a href="https://github.com/facebookresearch/llama/pull/73/files" target="_blank" rel="noreferrer noopener">링크</a>)</p>
<p>외국 친구들의 반응도 있으니 짤리기 전에 한번 보길 추천한다.</p>
<p>이번 유출로 인해 모델을 받아 손쉽게 customize, 테스트해 볼 수 있다.</p>
<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" />
<p>관련글</p>
<ul>
<li><a href="https://jinsbot.com/chatgpt-alternative/">chatGPT 한계점과 대체재에 대해</a></li>
<li><a href="https://jinsbot.com/gpt-3-5-python/">GPT-3.5 python에서 사용하기</a></li>
<li><a href="https://jinsbot.com/chat-gpt-hybrid-python/">chat GPT 하이브리드 앱 만들기 C# python</a></li>
<li><a href="https://jinsbot.com/gpt-4-introduction/">GPT-4 뭐가 달라 졌을까?</a></li>
<li><a href="https://jinsbot.com/%eb%b9%99-new-bing-intro/">빙 생성 AI 까지 넘보는 중</a></li>
</ul>
<p>The post <a href="https://jinsbot.com/gpt3-5-turbo/">GPT3.5 Turbo – ChatGPT python API 소개</a> appeared first on <a href="https://jinsbot.com">JIN&#039;s BOT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jinsbot.com/gpt3-5-turbo/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">877</post-id>	</item>
	</channel>
</rss>
