Spaces:
Runtime error
Runtime error
Commit
·
ba22794
1
Parent(s):
6aa3774
Removed set_configs due to error
Browse files- apps/home.py +34 -35
- 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 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
#st.
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
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(
|