Adam Helmi commited on
Commit
63f0c80
·
1 Parent(s): efc909f

Updating CORS policy

Browse files
Files changed (2) hide show
  1. app.py +9 -10
  2. index.html +4 -3
app.py CHANGED
@@ -9,16 +9,7 @@ from transformers import MBartForConditionalGeneration, MBartTokenizer, MBartCon
9
 
10
  # Load and display index.html
11
  html_string = open('index.html', 'r').read()
12
- components.html(html_string, height=600)
13
-
14
- # # Load JavaScript and CSS files using Streamlit
15
- # with open("styles.css", "r") as css_file:
16
- # css = css_file.read()
17
- # st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
18
-
19
- # with open("script.js", "r") as js_file:
20
- # js = js_file.read()
21
- # st.markdown(f"<script>{js}</script>", unsafe_allow_html=True)
22
 
23
  # Load model and tokenizer at startup
24
  MODEL_PATH = "GobLyne/Rumi-Jawi-Translater" # Path to your model folder
@@ -35,6 +26,14 @@ origins = [
35
  "http://35.175.72.198:8501",
36
  "http://10.27.69.196:8501",
37
  "http://localhost:8501",
 
 
 
 
 
 
 
 
38
  ]
39
 
40
  # Add CORS middleware
 
9
 
10
  # Load and display index.html
11
  html_string = open('index.html', 'r').read()
12
+ components.html(html_string, height=st.beta_container().container.height)
 
 
 
 
 
 
 
 
 
13
 
14
  # Load model and tokenizer at startup
15
  MODEL_PATH = "GobLyne/Rumi-Jawi-Translater" # Path to your model folder
 
26
  "http://35.175.72.198:8501",
27
  "http://10.27.69.196:8501",
28
  "http://localhost:8501",
29
+ "https://huggingface.co/spaces/GobLyne/Jawi-Translation",
30
+
31
+ VM89 about:srcdoc:4
32
+ POST https://huggingface.co/spaces/GobLyne/Jawi-Translation/translate net::ERR_FAILED
33
+ VM89 about:srcdoc:19 Error: TypeError: Failed to fetch
34
+ at translateText (VM89 about:srcdoc:4:32)
35
+ at HTMLButtonElement.<anonymous> (VM89 about:srcdoc:68:38)
36
+ "
37
  ]
38
 
39
  # Add CORS middleware
index.html CHANGED
@@ -9,11 +9,11 @@
9
  <body>
10
  <header>
11
  <div class="logo">Jawi Translator</div>
12
- <nav>
13
  <a href="#home">Home</a>
14
  <a href="#about">About</a>
15
  <a href="#contact">Contact Us</a>
16
- </nav>
17
  </header>
18
 
19
  <main>
@@ -48,7 +48,7 @@
48
  </footer>
49
  </body>
50
 
51
- <script src="script.js"></script>
52
 
53
  </html>
54
 
@@ -164,6 +164,7 @@
164
  }
165
 
166
  body {
 
167
  font-family: Arial, sans-serif;
168
  line-height: 1.6;
169
  background-color: #f8fcf9;
 
9
  <body>
10
  <header>
11
  <div class="logo">Jawi Translator</div>
12
+ <!-- <nav>
13
  <a href="#home">Home</a>
14
  <a href="#about">About</a>
15
  <a href="#contact">Contact Us</a>
16
+ </nav> -->
17
  </header>
18
 
19
  <main>
 
48
  </footer>
49
  </body>
50
 
51
+ <!-- <script src="script.js"></script> -->
52
 
53
  </html>
54
 
 
164
  }
165
 
166
  body {
167
+ height: 100%;
168
  font-family: Arial, sans-serif;
169
  line-height: 1.6;
170
  background-color: #f8fcf9;