writing-prompts / app.py
bramhampton's picture
Use secret for token
f3b7b82
import streamlit as st
import requests
API_URL = "https://api-inference.huggingface.co/models/bramhampton/wp-gen"
headers = {"Authorization": "Bearer " + st.secrets["token"]}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
promptBox = st.text_input("Please provide a starting point for your prompt")
if (len(promptBox) > 0):
st.write(query(promptBox)[0]["generated_text"])