yassonee commited on
Commit
69c9de9
·
verified ·
1 Parent(s): a72cc82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -2,20 +2,16 @@ import streamlit as st
2
  from transformers import pipeline
3
  from PIL import Image, ImageDraw
4
  import numpy as np
5
- import os
6
-
7
- # Configuration de base pour HF Spaces
8
- os.environ["STREAMLIT_SERVER_PORT"] = "7860"
9
- os.environ["STREAMLIT_SERVER_ADDRESS"] = "0.0.0.0"
10
- os.environ["STREAMLIT_SERVER_HEADLESS"] = "true"
11
- os.environ["STREAMLIT_SERVER_ENABLE_CORS"] = "true"
12
 
13
  # Configuration de la page
14
- st.set_page_config(
15
- page_title="Fraktur Detektion",
16
- layout="wide",
17
- initial_sidebar_state="collapsed"
18
- )
 
 
 
19
 
20
  @st.cache_resource
21
  def load_models():
@@ -88,10 +84,10 @@ def main():
88
  st.markdown("""
89
  <style>
90
  .stApp {background: #f0f2f5}
91
- .block-container {max-width: 1400px; padding-top: 1rem; padding-bottom: 1rem}
92
  div[data-testid="stToolbar"] {display: none}
93
  #MainMenu {visibility: hidden}
94
  footer {visibility: hidden}
 
95
  .result-box {
96
  background: #f8f9fa;
97
  padding: 0.75rem;
 
2
  from transformers import pipeline
3
  from PIL import Image, ImageDraw
4
  import numpy as np
 
 
 
 
 
 
 
5
 
6
  # Configuration de la page
7
+ if 'page_config' not in st.session_state:
8
+ st.set_page_config(
9
+ page_title="Fraktur Detektion",
10
+ layout="wide",
11
+ initial_sidebar_state="collapsed",
12
+ menu_items=None
13
+ )
14
+ st.session_state.page_config = True
15
 
16
  @st.cache_resource
17
  def load_models():
 
84
  st.markdown("""
85
  <style>
86
  .stApp {background: #f0f2f5}
 
87
  div[data-testid="stToolbar"] {display: none}
88
  #MainMenu {visibility: hidden}
89
  footer {visibility: hidden}
90
+ header {visibility: hidden}
91
  .result-box {
92
  background: #f8f9fa;
93
  padding: 0.75rem;