Spaces:
Sleeping
Sleeping
File size: 405 Bytes
dac79e1 f5a63cf dac79e1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import streamlit as st
import requests
API_URL = "https://api-inference.huggingface.co/models/google/gemma-7b-it"
headers = {"Authorization": st.secrets["access_token"]}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
text = st.text_area("Enter a sentence !!!")
if text:
output = query({
"inputs": text,
})
st.json(output) |