μλ
νμΈμ.
μ κ° κ°μ§κ³ μλ λ°μ΄ν°μ
μ λν΄ ν΄λ‘λ°μ λ²€μΉλ§ν¬ μ±λ₯μ μΈ‘μ νκ³ μ νλλ°, Errorcode 500
μ€λ₯κ° λ°μν΄μ λ¬Έμλ₯Ό λλ¦¬κ³ μ ν©λλ€.
μ½λλ λ€μκ³Ό κ°μ΅λλ€.
import pandas as pd
from clovax import ClovaX
data = pd.read_csv('~/spam552_final_test_small.csv')
content = """8κ°μ classμ€ νλλ‘ μ£Όμ΄μ§ ν
μ€νΈλ₯Ό λΆλ₯ν΄μ€. μ΄ λΆλ₯λ ν
μ€νΈ λ§μ΄λμ μν μ μ²λ¦¬μΌ.
Classes: [`μνκ΄κ³ `, `μνκ±°λ`, ... , `μ μκΈ`]
μλμλ few-shot μμ κ° μμ΄.
Text: (μλ΅)
Class: `μνκ΄κ³ `
... (μλ΅) ...
"""
c = ClovaX()
c.get_cookie("~/clova-x.naver.com_cookies.txt")
def clova_gen(text):
return c.start(content + text)['text']
outs=[clova_gen(text) for text in data['μ λͺ©']+'\n'+data['λ΄μ©']]
μ΄μ λν μ 체 μ€λ₯λ©μΈμ§κ° λ€μκ³Ό κ°μ΄ λ°μνμ΅λλ€.
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
Cell In[14], line 1
----> 1 outs=[clova_gen(text) for text in data['μ λͺ©']+'\n'+data['λ΄μ©']]
Cell In[14], line 1, in (.0)
----> 1 outs=[clova_gen(text) for text in data['μ λͺ©']+'\n'+data['λ΄μ©']]
Cell In[11], line 4, in clova_gen(text)
3 def clova_gen(text):
----> 4 return c.start(content + text)['text']
File [~/anaconda3/envs/garbagespam/lib/python3.11/site-packages/clovax/clovax.py:170](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/workspace/electra_garbagespam/~/anaconda3/envs/lucy3/lib/python3.11/site-packages/clovax/clovax.py:170), in ClovaX.start(self, prompt, skillsets)
167 data = self._build_data("new", prompt, skillsets=skillsets)
168 self.conversation_id = ""
--> 170 r = self._do_conversation(data)
172 # Iterate event stream, get event and datas
173 for line in r.iter_lines(decode_unicode=True):
File [~/anaconda3/envs/garbagespam/lib/python3.11/site-packages/clovax/clovax.py:132](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/workspace/electra_garbagespam/~/anaconda3/envs/lucy3/lib/python3.11/site-packages/clovax/clovax.py:132), in ClovaX._do_conversation(self, data)
130 raise clovax.errors.TooManyRequestsError()
131 else:
--> 132 raise Exception(
133 f"Error occurred while starting conversation. Error code: {r.status_code}"
134 )
135 r.encoding = "utf-8"
136 return r
Exception: Error occurred while starting conversation. Error code: 500
νΉμ Errorcode 500μ΄ μ΄λ€ μ νμ λ¬Έμ μμ λΉλ‘―λλμ§μ λν΄ μ 보λ₯Ό 곡μ ν΄μ£Όμ€ μ μλμ§ μ¬μ€λ³΄κ³ μΆμ΅λλ€.
μ’μ λ ν¬ λ§λ€μ΄μ£Όμ
μ κ°μ¬ν©λλ€.