Spaces:
Sleeping
Sleeping
| 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) |