Authentication
Browse files- api_client.py +1 -0
- app.py +2 -2
api_client.py
CHANGED
|
@@ -10,6 +10,7 @@ headers = {"Authorization": f"Bearer {os.getenv('HF_TOKEN_POKEMON')}"}
|
|
| 10 |
|
| 11 |
|
| 12 |
def predict(image_bytes: bytes, filename: str) -> dict:
|
|
|
|
| 13 |
"""Send image to backend /predict endpoint with detailed error info"""
|
| 14 |
try:
|
| 15 |
response = requests.post(
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def predict(image_bytes: bytes, filename: str) -> dict:
|
| 13 |
+
print("TOKEN VALUE:", os.getenv("HF_TOKEN_POKEMON"))
|
| 14 |
"""Send image to backend /predict endpoint with detailed error info"""
|
| 15 |
try:
|
| 16 |
response = requests.post(
|
app.py
CHANGED
|
@@ -46,11 +46,11 @@ uploaded_file = render_upload_section()
|
|
| 46 |
|
| 47 |
if uploaded_file:
|
| 48 |
image_bytes = uploaded_file.read()
|
| 49 |
-
|
| 50 |
|
| 51 |
image = Image.open(io.BytesIO(image_bytes))
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
col1, col2 = st.columns([1, 2])
|
| 56 |
|
|
|
|
| 46 |
|
| 47 |
if uploaded_file:
|
| 48 |
image_bytes = uploaded_file.read()
|
| 49 |
+
st.write("Reading card...")
|
| 50 |
|
| 51 |
image = Image.open(io.BytesIO(image_bytes))
|
| 52 |
|
| 53 |
+
st.write("Successfully uploaded card")
|
| 54 |
|
| 55 |
col1, col2 = st.columns([1, 2])
|
| 56 |
|