Solar-Iz commited on
Commit
ebfc9ef
·
1 Parent(s): c7490aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,13 +12,13 @@ def main():
12
  if image is not None:
13
  st.image(image)
14
  files = {"file": image.getvalue()}
15
- res = requests.post("http://127.0.0.1:8000/classify", files=files)
16
  st.write(json.loads(res.text)['prediction'])
17
 
18
  # Эндпоинт для классификации текста
19
  text_input = st.text_input("Enter text for classification:")
20
  if st.button("Classify Text"):
21
- response = requests.post("http://127.0.0.1:8000/clf_text", json={"text": text_input})
22
  result = response.json()
23
  st.success(f"Classification result: {result['prediction']}")
24
 
 
12
  if image is not None:
13
  st.image(image)
14
  files = {"file": image.getvalue()}
15
+ res = requests.post("/classify", files=files)
16
  st.write(json.loads(res.text)['prediction'])
17
 
18
  # Эндпоинт для классификации текста
19
  text_input = st.text_input("Enter text for classification:")
20
  if st.button("Classify Text"):
21
+ response = requests.post("/clf_text", json={"text": text_input})
22
  result = response.json()
23
  st.success(f"Classification result: {result['prediction']}")
24