<?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>GPT3 Archives - JIN&#039;s BOT</title>
	<atom:link href="https://jinsbot.com/tag/gpt3/feed/" rel="self" type="application/rss+xml" />
	<link>https://jinsbot.com/tag/gpt3/</link>
	<description>Coding + Engineering</description>
	<lastBuildDate>Sun, 22 Sep 2024 11:17:28 +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>GPT-3.5 python에서 사용하기</title>
		<link>https://jinsbot.com/gpt-3-5-python/</link>
					<comments>https://jinsbot.com/gpt-3-5-python/#respond</comments>
		
		<dc:creator><![CDATA[geniuskpj]]></dc:creator>
		<pubDate>Tue, 07 Feb 2023 09:27:43 +0000</pubDate>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[chatGPT]]></category>
		<category><![CDATA[GPT]]></category>
		<category><![CDATA[GPT3]]></category>
		<category><![CDATA[openAI]]></category>
		<category><![CDATA[생성AI]]></category>
		<guid isPermaLink="false">https://jinsbot.com/?p=869</guid>

					<description><![CDATA[<p>GPT-3 는 OpenAI 가 개발한 대형 언어 모델 (Large Language Model, LLM )이다. 12Billion (120억)개의 paramter를 가지는것이 특징이고 Github Copiliot에 사용되어 유명해졌다. 최근 각광받는 chatGPT 가 GPT-3.5 에 해당하며 무려 170B( 1700억) 개의 parmeter를 가진다. chatGPT는 23년 2월 기준 아직 python api 가 공개되지 않았지만 같은 GPT-3.5에 속하는 davinci 모델은 python에서 사용 가능하다. text-davinci-003 는 [&#8230;]</p>
<p>The post <a href="https://jinsbot.com/gpt-3-5-python/">GPT-3.5 python에서 사용하기</a> appeared first on <a href="https://jinsbot.com">JIN&#039;s BOT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>GPT-3 는 OpenAI 가 개발한 대형 언어 모델 (Large Language Model, LLM )이다.</p>
<p>12Billion (120억)개의 paramter를 가지는것이 특징이고</p>
<p><a href="https://namu.wiki/w/GitHub%20Copilot" target="_blank" rel="noreferrer noopener">Github Copiliot</a>에 사용되어 유명해졌다.</p>
<p>최근 각광받는 chatGPT 가 GPT-3.5 에 해당하며</p>
<p>무려 170B( 1700억) 개의 parmeter를 가진다.</p>
<p>chatGPT는 23년 2월 기준 아직 python api 가 공개되지 않았지만</p>
<p><a href="https://platform.openai.com/docs/model-index-for-researchers" target="_blank" rel="noreferrer noopener">같은 GPT-3.5</a>에 속하는 davinci 모델은 python에서 사용 가능하다.</p>
<p>text-davinci-003 는 21년 4분기까지의 데이터로 학습되었기 때문에</p>
<p>chatGPT 에 비해 약간 떨어지지만 충분히 훌륭한 성능을 보여준다.</p>
<h3 class="wp-block-heading">그래서 사용법은?</h3>
<p>이 <a href="https://openai.com/api/" target="_blank" rel="noreferrer noopener">링크</a>에서 회원가입이 가능하고 <a href="https://platform.openai.com/docs/api-reference/introduction" target="_blank" rel="noreferrer noopener">문서</a>도 잘 만들어져 있다.</p>
<p>openai 패키지 사용법은 해당 문서에 잘 나와 있으니</p>
<p>패키지 없이 사용하는 법을 설명하겠다.</p>
<p>우선 가입 후 <a href="https://platform.openai.com/account/api-keys" target="_blank" rel="noreferrer noopener">링크</a>에 들어가 api-key를 발급받는다.</p>
<p>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 발급받은API키","Content-Type":"application/json"}
link="https://api.openai.com/v1/completions"
data={"model": "text-davinci-003", "prompt": "let me know how to cook scones ", "temperature": 0.9, "max_tokens": 300}
res=requests.post(link,data=json.dumps(data),headers=headers)
print(res.json()['choices'][0]['text'])</pre>
<p>input에 대해 설명하자면 다음과 같다.</p>
<ul>
<li>link:질문에 해당하는 링크이며 image 생성 등에는 다른 링크가 필요하다.</li>
<li>prompt: 질문이나 요청을 적으면 된다.</li>
<li>temperature: 높을수록 창의적이지만 부정확한 답이 출력될 수 있다. (기본값:1)</li>
<li>top_p: 방법은 다르지만 temperature와 같은 역할, temperature와 top_p 둘 중 하나만 사용 (기본값:1)</li>
<li>max_tokens: 답변 문장의 최대 길이를 결정함</li>
<li><a href="https://platform.openai.com/docs/api-reference/completions/create" target="_blank" rel="noreferrer noopener">이외는 링크 참조바람</a></li>
</ul>
<h3 class="wp-block-heading">GPT 3.5 사용결과</h3>
<h4 class="wp-block-heading">상식</h4>
<p><strong>질문</strong><br />
: <em>let me know how to cook scones.</em></p>
<p><img decoding="async" src="https://s0.wp.com/latex.php?latex=%5Crightarrow&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#92;rightarrow" class="latex" />Ingredients</p>
<ul>
<li>3 cups all-purpose flour</li>
<li>1 tablespoon baking powder</li>
<li>1/2 teaspoon salt</li>
<li>3/4 cup butter, melted</li>
<li>2 eggs</li>
<li>1/2 cup milk</li>
<li>1/2 cup sugar</li>
</ul>
<p>Directions</p>
<ol>
<li>Preheat oven to 400 degrees F (200 degrees C). Grease a baking sheet.</li>
<li>In a large bowl, sift together flour, baking powder and salt.</li>
<li>In a separate bowl, stir together melted butter, eggs and milk.</li>
<li>Make a well in the center of the flour mixture, and pour in the wet ingredients.</li>
<li>Stir together until a soft dough forms. Stir in sugar.</li>
<li>Roll out dough on a lightly floured surface, and cut into desired shapes (e.g. circles or wedges).</li>
<li>Place on prepared baking sheet, and bake for 10 to 12 minutes. Remove from oven, and cool. Serve warm.</li>
</ol>
<p>굽는 시간, 재료의 양에 차이가 있지만 충분히 조리 가능한 레시피이며</p>
<p>chatGPT로부터 받은 답변도 대동소이 했다.</p>
<h4 class="wp-block-heading">코딩</h4>
<p><strong>질문</strong>: <em>suggest me top 5 alternatives of pyqt.</em></p>
<p><img decoding="async" src="https://s0.wp.com/latex.php?latex=%5Crightarrow&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#92;rightarrow" class="latex" /></p>
<ol>
<li>GTK+</li>
<li>wxPython</li>
<li>Kivy</li>
<li>Tkinter</li>
<li>PySide</li>
</ol>
<p>사용가능한 라이브러리들을 잘 보여준다.</p>
<p>ChatGPT 에 물어보면 부연설명을 넣어주지만 pyside가 빠지는 점이 아쉽다.</p>
<p><strong>질문</strong>: <em>What ’s the difference between pyside and pyqt</em></p>
<p><img decoding="async" src="https://s0.wp.com/latex.php?latex=%5Crightarrow&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#92;rightarrow" class="latex" />PySide and PyQt are both Python bindings for the popular Qt cross-platform application and UI framework. The main difference between the two is that PySide is free and open source, while PyQt is proprietary and subject to a commercial license. PySide also has a more liberal license than PyQt, which allows developers to use it for both open source and commercial projects. PySide also has a more modern API, which makes it easier to use than PyQt.</p>
<p>마지막에 엉뚱한 말이 붙었지만 전반적으로 핵심을 잘 파악한 훌륭한 답변이다.</p>
<p>chatGPT가 community 규모에 대해 좀 더 정확한 정보를 덧붙였다.</p>
<p><strong>질문</strong>: <em>can you give me streamlit example for python? It ’s for drawing graph</em></p>
<p><img decoding="async" src="https://s0.wp.com/latex.php?latex=%5Crightarrow&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="&#92;rightarrow" class="latex" /></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 streamlit as st
import matplotlib.pyplot as plt

#Create some data

x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]

#Create the plot

plt.plot(x, y)

#Add the plot to the Streamlit app

st.pyplot()</pre>
<p>pyplot의 argument가 빠졌다는 warning이 뜨지만 잘 plot 된다.</p>
<p>chatGPT 의 답변에는 무의미한 코드가 한줄 있지만 좀 더 상세했다.</p>
<h3 class="wp-block-heading">GPT 3.5 단점은 없어?</h3>
<p>현재 Davinci 모델은 유료이며 <strong>1k token(750 단어)당 0.02$</strong>의 사용료가</p>
<p>책정되어있다. 그리고 돌아올 수 있는 답변은 최대 4000token(3000단어)이다.</p>
<p>저렴한 가격이지만 chatGPT가 앞으로도 무료 서비스를 제공한다면</p>
<p>일반 사용자에게 merit이 떨어 진다.</p>
<p>또한 chatGPT와 달리 답변에 추가적인 질문이 불가능하다.</p>
<h3 class="wp-block-heading">유료면 이걸 왜써?</h3>
<p>가입시 3개월간 사용가능한 18$의 credit을 제공하기때문에</p>
<p>계정을 만들어가며 사용하면 무한대로 사용이 가능 하다.</p>
<p>게다가 현재 davinci모델은 추가학습( fine-tuning) 이 가능하다.</p>
<p>즉, 업체나 개인별로 자신에게 필요한 데이터 일부를</p>
<p>추가적으로 학습시킬 수 있는 강력한 기능을 제공한다.</p>
<p>현재 chatGPT 는 추후 활용을 위해 피드백을 수집할 뿐</p>
<p>추가적으로 학습이 이루어지지 않는다.</p>
<p>GPT3.5의 추가 학습 및 사용에는 각각</p>
<p>1k token 당 <strong>0.03$,0.12</strong>$의 비용이 부과된다.</p>
<p>그렇다면 학습에 별도 비용이 발생하지 않는 대체재는 없을까?</p>
<p><a href="https://jinsbot.com/chatgpt-alternative/" target="_blank" rel="noreferrer noopener">다음글</a>에서 chatGPT의 한계점을 짚어보며 대체재에 대해 소개하겠다.</p>
<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" />
<p>ChatGPT의 python API가 출시 되었다. (23.03.01)</p>
<p><a href="https://jinsbot.com/gpt3-5-turbo/">GPT3.5 Turbo – ChatGPT python API 소개</a></p>
<p><a href="https://jinsbot.com/chat-gpt-hybrid-python/">chat GPT 하이브리드 앱 만들기 C# python</a></p>
<p>관련글</p>
<p><a href="https://jinsbot.com/gpt-4-introduction/">GPT-4 뭐가 달라 졌을까?</a></p>
<p><a href="https://jinsbot.com/%eb%b9%99-new-bing-intro/">빙 생성 AI 까지 넘보는 중</a></p>
<p>The post <a href="https://jinsbot.com/gpt-3-5-python/">GPT-3.5 python에서 사용하기</a> appeared first on <a href="https://jinsbot.com">JIN&#039;s BOT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jinsbot.com/gpt-3-5-python/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">869</post-id>	</item>
	</channel>
</rss>
