Akshay-More-007/meme
0
1import streamlit as st2import requests3from io import BytesIO4from PIL import Image5import os6 7api_key = os.environ['API_KEY']8 9API_URL = "https://api-inference.huggingface.co/models/Hrishikesh332/autotrain-meme-classification-42897109437"10headers = {"Authorization": f"Bearer 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"}11 12def query(data : bytes):13 14 response = requests.post(API_URL, headers=headers, data=data)15 return response.json()16 17st.markdown("<h1 style='text-align: center;'>Memeter 💬</h1>", unsafe_allow_html=True)18st.markdown("---")19with st.sidebar:20 st.title("Memeter")21 st.caption('''22 23 Memeter is an application used for the classification of whether the images provided is meme or not meme24 ''', unsafe_allow_html=False)25 26img = st.file_uploader("Choose an image", type=["jpg", "jpeg", "png"])27 28if img is not None:29 30 data = img.read()31 output = query(data)32 st.write("Predicted Output:", output)33 