Hyeonseo commited on
Commit
c7553f2
β€’
1 Parent(s): b2277aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -45,13 +45,10 @@ def translate_with_upload(text, file):
45
  openapi_key = text
46
 
47
  if file is not None:
48
- print("Uploaded file name:", file.name)
49
  with open(file.name, 'r') as f:
50
- content = f.read()
51
- print(content)
52
- print("Uploaded file content:")
53
- print(file.read().decode('utf-8'))
54
- text_input = file.read().decode('utf-8')
55
  print(text_input)
56
  # ν…μŠ€νŠΈμ—μ„œ μ½”λ“œ 블둝을 μ œκ±°ν•©λ‹ˆλ‹€.
57
  text_input = re.sub(r'```.*?```', '', text_input, flags=re.DOTALL)
 
45
  openapi_key = text
46
 
47
  if file is not None:
48
+ text_input = ""
49
  with open(file.name, 'r') as f:
50
+ text_input += f.read()
51
+ text_input += '\n'
 
 
 
52
  print(text_input)
53
  # ν…μŠ€νŠΈμ—μ„œ μ½”λ“œ 블둝을 μ œκ±°ν•©λ‹ˆλ‹€.
54
  text_input = re.sub(r'```.*?```', '', text_input, flags=re.DOTALL)