Update app.py
Browse files
app.py
CHANGED
@@ -71,16 +71,20 @@ def engsum(output):
|
|
71 |
response = requests.post(API_URL1, headers=headers1, json=payload)
|
72 |
return response.json()
|
73 |
|
74 |
-
|
75 |
"inputs": output,
|
76 |
})
|
77 |
-
|
|
|
|
|
78 |
def bansum(text):
|
79 |
def query(payload):
|
80 |
response = requests.post(API_URL0, headers=headers0, json=payload)
|
81 |
return response.json()
|
82 |
-
|
83 |
-
|
|
|
|
|
84 |
|
85 |
st.title("NLP APPLICATION")
|
86 |
#@st.cache_resource(experimental_allow_widgets=True)
|
@@ -166,8 +170,6 @@ def main():
|
|
166 |
if isinstance(out, list) and out[0].get("generated_text"):
|
167 |
text_output = out[0]["generated_text"]
|
168 |
st.success(text_output)
|
169 |
-
if st.checkbox("Summarize generated text"):
|
170 |
-
engsum(text_output)
|
171 |
|
172 |
if st.checkbox("Mark for Text Summarization"):
|
173 |
if b==1:
|
|
|
71 |
response = requests.post(API_URL1, headers=headers1, json=payload)
|
72 |
return response.json()
|
73 |
|
74 |
+
out = query({
|
75 |
"inputs": output,
|
76 |
})
|
77 |
+
if isinstance(out, list) and out[0].get("generated_text"):
|
78 |
+
text_output = out[0]["generated_text"]
|
79 |
+
st.success(text_output)
|
80 |
def bansum(text):
|
81 |
def query(payload):
|
82 |
response = requests.post(API_URL0, headers=headers0, json=payload)
|
83 |
return response.json()
|
84 |
+
out = query({"inputs": text})
|
85 |
+
if isinstance(out, list) and out[0].get("generated_text"):
|
86 |
+
text_output = out[0]["generated_text"]
|
87 |
+
st.success(text_output)
|
88 |
|
89 |
st.title("NLP APPLICATION")
|
90 |
#@st.cache_resource(experimental_allow_widgets=True)
|
|
|
170 |
if isinstance(out, list) and out[0].get("generated_text"):
|
171 |
text_output = out[0]["generated_text"]
|
172 |
st.success(text_output)
|
|
|
|
|
173 |
|
174 |
if st.checkbox("Mark for Text Summarization"):
|
175 |
if b==1:
|