yirmibesogluz commited on
Commit
ba22794
·
1 Parent(s): 6aa3774

Removed set_configs due to error

Browse files
Files changed (2) hide show
  1. apps/home.py +34 -35
  2. apps/summarization.py +2 -2
apps/home.py CHANGED
@@ -4,43 +4,42 @@ import time
4
  from transformers import pipeline
5
  import os
6
 
7
- st.set_page_config(page_title="TURNA")
8
-
9
  API_URL = "https://api-inference.huggingface.co/models/boun-tabi-LMG/TURNA"
10
 
11
- st.markdown(
12
- """
13
- <h1 style="text-align:left;">TURNA</h1>
14
- """,
15
- unsafe_allow_html=True,
16
- )
17
-
18
- st.write("#")
19
-
20
- col = st.columns(2)
21
-
22
- col[0].image("images/turna-logo.png", width=100)
23
-
24
- st.markdown(
25
- """
26
-
27
- <h3 style="text-align:right;">TURNA is a Turkish encoder-decoder language model.</h3>
28
-
29
- <p style="text-align:right;"><p>
30
- <p style="text-align:right;">Use the generation paramters on the sidebar to adjust generation quality.</p>
31
- <p style="text-align:right;"><p>
32
- """,
33
- unsafe_allow_html=True,
34
- )
35
-
36
- #st.title('Turkish Language Generation')
37
- #st.write('...with Turna')
38
- input_text = st.text_area(label='Enter a text: ', height=100,
39
- value="Türkiye'nin başkeni neresidir?")
40
- if st.button("Generate"):
41
- with st.spinner('Generating...'):
42
- output = query(input_text)
43
- st.success(output)
 
44
 
45
  def query(payload):
46
  #{"inputs": payload, ""}
 
4
  from transformers import pipeline
5
  import os
6
 
 
 
7
  API_URL = "https://api-inference.huggingface.co/models/boun-tabi-LMG/TURNA"
8
 
9
+ def write():
10
+ st.markdown(
11
+ """
12
+ <h1 style="text-align:left;">TURNA</h1>
13
+ """,
14
+ unsafe_allow_html=True,
15
+ )
16
+
17
+ st.write("#")
18
+
19
+ col = st.columns(2)
20
+
21
+ col[0].image("images/turna-logo.png", width=100)
22
+
23
+ st.markdown(
24
+ """
25
+
26
+ <h3 style="text-align:right;">TURNA is a Turkish encoder-decoder language model.</h3>
27
+
28
+ <p style="text-align:right;"><p>
29
+ <p style="text-align:right;">Use the generation paramters on the sidebar to adjust generation quality.</p>
30
+ <p style="text-align:right;"><p>
31
+ """,
32
+ unsafe_allow_html=True,
33
+ )
34
+
35
+ #st.title('Turkish Language Generation')
36
+ #st.write('...with Turna')
37
+ input_text = st.text_area(label='Enter a text: ', height=100,
38
+ value="Türkiye'nin başkeni neresidir?")
39
+ if st.button("Generate"):
40
+ with st.spinner('Generating...'):
41
+ output = query(input_text)
42
+ st.success(output)
43
 
44
  def query(payload):
45
  #{"inputs": payload, ""}
apps/summarization.py CHANGED
@@ -4,13 +4,13 @@ import time
4
  from transformers import pipeline
5
  import os
6
 
7
- st.set_page_config(page_title="Text Summarization", page_icon="📈")
8
-
9
  HF_AUTH_TOKEN = os.getenv('HF_AUTH_TOKEN')
10
  headers = {"Authorization": f"Bearer {HF_AUTH_TOKEN}"}
11
 
12
  def write():
13
 
 
 
14
  st.markdown("# Text Summarization")
15
  st.sidebar.header("Text Summarization")
16
  st.write(
 
4
  from transformers import pipeline
5
  import os
6
 
 
 
7
  HF_AUTH_TOKEN = os.getenv('HF_AUTH_TOKEN')
8
  headers = {"Authorization": f"Bearer {HF_AUTH_TOKEN}"}
9
 
10
  def write():
11
 
12
+ #st.set_page_config(page_title="Text Summarization", page_icon="📈")
13
+
14
  st.markdown("# Text Summarization")
15
  st.sidebar.header("Text Summarization")
16
  st.write(