Spaces:
Sleeping
Sleeping
Commit
·
8ba7dca
1
Parent(s):
1af56e2
remove the api point
Browse files- .gitignore +0 -0
- app.py +17 -13
.gitignore
ADDED
|
File without changes
|
app.py
CHANGED
|
@@ -9,20 +9,24 @@ st.set_page_config(page_title="Sentence Correction", page_icon="📝", layout="c
|
|
| 9 |
st.title("Sentence Correction")
|
| 10 |
|
| 11 |
user_input=st.text_area("Enter text: ")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
if st.button("Remove Error"):
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
|
| 28 |
|
|
|
|
| 9 |
st.title("Sentence Correction")
|
| 10 |
|
| 11 |
user_input=st.text_area("Enter text: ")
|
| 12 |
+
if st.button("Remove Error: "):
|
| 13 |
+
response=model_prediction(text=user_input)
|
| 14 |
+
st.error(f"Original Text: {user_input}")
|
| 15 |
+
st.success(f"Model Prediction: {response}")
|
| 16 |
|
| 17 |
+
# if st.button("Remove Error"):
|
| 18 |
+
# with st.status("Hitting the api please wait...."):
|
| 19 |
+
# try:
|
| 20 |
+
# response=requests.post("http://localhost:8000/predict", json={"text": user_input})
|
| 21 |
+
# if response.status_code == 200:
|
| 22 |
+
# result = response.json()
|
| 23 |
+
# st.error(f"Original Text: {result['original_text']}")
|
| 24 |
+
# st.success(f"Model Prediction: {result['corrected_text']}")
|
| 25 |
+
# # st.json(result)
|
| 26 |
+
# else:
|
| 27 |
+
# st.error("Error in fetching prediction from the API.")
|
| 28 |
+
# except Exception as e:
|
| 29 |
+
# st.write(f"There should be some issue in the api serving {e}")
|
| 30 |
|
| 31 |
|
| 32 |
|