Update app.py
Browse files
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 |
-
|
49 |
with open(file.name, 'r') as f:
|
50 |
-
|
51 |
-
|
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)
|