sami606713 commited on
Commit
8ba7dca
·
1 Parent(s): 1af56e2

remove the api point

Browse files
Files changed (2) hide show
  1. .gitignore +0 -0
  2. 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
- with st.status("Hitting the api please wait...."):
15
- try:
16
- response=requests.post("http://localhost:8000/predict", json={"text": user_input})
17
- if response.status_code == 200:
18
- result = response.json()
19
- st.error(f"Original Text: {result['original_text']}")
20
- st.success(f"Model Prediction: {result['corrected_text']}")
21
- # st.json(result)
22
- else:
23
- st.error("Error in fetching prediction from the API.")
24
- except Exception as e:
25
- st.write(f"There should be some issue in the api serving {e}")
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