Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,11 @@ OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1"
|
|
28 |
def initialize_ocr():
|
29 |
"""Inisialisasi model PaddleOCR."""
|
30 |
try:
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
except Exception as e:
|
33 |
st.error(f"Gagal inisialisasi OCR: {e}")
|
34 |
return None
|
@@ -184,4 +188,4 @@ if st.session_state.get('calculated'):
|
|
184 |
|
185 |
# Footer
|
186 |
st.markdown("---")
|
187 |
-
st.markdown("<p style='text-align:center;'>Nutri-Grade App v2.1 © 2024</p>", unsafe_allow_html=True)
|
|
|
28 |
def initialize_ocr():
|
29 |
"""Inisialisasi model PaddleOCR."""
|
30 |
try:
|
31 |
+
# Menggunakan CPU, tanpa parameter yang tidak dikenali
|
32 |
+
return PaddleOCR(use_gpu=False, lang='en', use_angle_cls=True)
|
33 |
+
except Exception as e:
|
34 |
+
st.error(f"Gagal inisialisasi OCR: {e}")
|
35 |
+
return None
|
36 |
except Exception as e:
|
37 |
st.error(f"Gagal inisialisasi OCR: {e}")
|
38 |
return None
|
|
|
188 |
|
189 |
# Footer
|
190 |
st.markdown("---")
|
191 |
+
st.markdown("<p style='text-align:center;'>Nutri-Grade App v2.1 © 2024</p>", unsafe_allow_html=True)
|