ginipick commited on
Commit
e03d258
Β·
verified Β·
1 Parent(s): 46b5d6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -17,10 +17,10 @@ def load_code(filename: str) -> str:
17
  try:
18
  with open(filename, 'r', encoding='utf-8') as file:
19
  return file.read()
20
- except FileNotFoundError:
21
- return f"{filename} νŒŒμΌμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."
22
- except Exception as e:
23
- return f"νŒŒμΌμ„ μ½λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: {str(e)}"
24
 
25
  def load_parquet(filename: str) -> str:
26
  try:
@@ -127,7 +127,9 @@ def text_to_parquet(text: str) -> Tuple[str, str, str]:
127
  dtype=str,
128
  quoting=csv.QUOTE_ALL, # λͺ¨λ“  ν•„λ“œλ₯Ό ν°λ”°μ˜΄ν‘œλ‘œ κ°μ‹ΈλŠ” κ²ƒμœΌλ‘œ 처리
129
  escapechar='\\', # μ΄μŠ€μΌ€μ΄ν”„ 문자 μ„€μ •
130
- engine='python' # Python 엔진 μ‚¬μš©
 
 
131
  )
132
  # 데이터 μœ ν˜• μ΅œμ ν™”
133
  df = df.astype({'id': 'int32', 'text': 'string', 'label': 'string', 'metadata': 'string'})
@@ -402,3 +404,4 @@ if __name__ == "__main__":
402
 
403
 
404
 
 
 
17
  try:
18
  with open(filename, 'r', encoding='utf-8') as file:
19
  return file.read()
20
+ except FileNotFoundError:
21
+ return f"{filename} νŒŒμΌμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."
22
+ except Exception as e:
23
+ return f"νŒŒμΌμ„ μ½λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: {str(e)}"
24
 
25
  def load_parquet(filename: str) -> str:
26
  try:
 
127
  dtype=str,
128
  quoting=csv.QUOTE_ALL, # λͺ¨λ“  ν•„λ“œλ₯Ό ν°λ”°μ˜΄ν‘œλ‘œ κ°μ‹ΈλŠ” κ²ƒμœΌλ‘œ 처리
129
  escapechar='\\', # μ΄μŠ€μΌ€μ΄ν”„ 문자 μ„€μ •
130
+ engine='python', # Python 엔진 μ‚¬μš©
131
+ header=None, # 첫 번째 행을 μ—΄ μ΄λ¦„μœΌλ‘œ μ‚¬μš©ν•˜μ§€ μ•ŠμŒ
132
+ names=['id', 'text', 'label', 'metadata'] # μ—΄ 이름 지정
133
  )
134
  # 데이터 μœ ν˜• μ΅œμ ν™”
135
  df = df.astype({'id': 'int32', 'text': 'string', 'label': 'string', 'metadata': 'string'})
 
404
 
405
 
406
 
407
+