File size: 440 Bytes
b17ac36
 
 
 
f3b7b82
b17ac36
 
 
 
 
3c37c4f
 
 
9ce542b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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"])