Spaces:
Sleeping
Sleeping
LucasAguetai
commited on
Commit
·
3b808f0
1
Parent(s):
e3eecf8
resolve fastapi
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
|
|
2 |
import requests
|
3 |
import streamlit as st
|
4 |
|
5 |
-
siteUrl = "
|
6 |
|
7 |
userContext = None
|
8 |
context = None
|
@@ -13,10 +13,10 @@ with st.sidebar:
|
|
13 |
contextSelect = st.radio("Pick a context mode:", ["File", "Text"])
|
14 |
if contextSelect == "File":
|
15 |
userContext = st.file_uploader("Pick a file for the context", accept_multiple_files=True)
|
16 |
-
context = "/uploadfile"
|
17 |
else:
|
18 |
userContext = st.text_input("write the context")
|
19 |
-
context = "/contextText"
|
20 |
|
21 |
st.title("ALOQAS")
|
22 |
|
@@ -45,7 +45,7 @@ if prompt := st.chat_input(placeholder="Write to ALOQAS..."):
|
|
45 |
params["context"] = userContext
|
46 |
response = requests.post(siteUrl + context, params=params)
|
47 |
else:
|
48 |
-
response = requests.post(siteUrl + '/withoutFile', params=params)
|
49 |
|
50 |
st.write("Statut de la requête:", response.status_code)
|
51 |
st.write("Réponse du serveur:", response.text)
|
|
|
2 |
import requests
|
3 |
import streamlit as st
|
4 |
|
5 |
+
siteUrl = "http://127.0.0.1:8000"
|
6 |
|
7 |
userContext = None
|
8 |
context = None
|
|
|
13 |
contextSelect = st.radio("Pick a context mode:", ["File", "Text"])
|
14 |
if contextSelect == "File":
|
15 |
userContext = st.file_uploader("Pick a file for the context", accept_multiple_files=True)
|
16 |
+
context = "/uploadfile/"
|
17 |
else:
|
18 |
userContext = st.text_input("write the context")
|
19 |
+
context = "/contextText/"
|
20 |
|
21 |
st.title("ALOQAS")
|
22 |
|
|
|
45 |
params["context"] = userContext
|
46 |
response = requests.post(siteUrl + context, params=params)
|
47 |
else:
|
48 |
+
response = requests.post(siteUrl + '/withoutFile/', params=params)
|
49 |
|
50 |
st.write("Statut de la requête:", response.status_code)
|
51 |
st.write("Réponse du serveur:", response.text)
|