neovalle's picture
Create app.py
1cb836d verified
raw
history blame
692 Bytes
import requests
import gradio as gr
# The model endpoint on Hugging Face
API_URL = "https://api-inference.huggingface.co/models/neovalle/H4rmoniousBreeze"
def query_model(prompt):
# If your model is public, you may not need an API token.
# If it’s private, you'll need:
# headers = {"Authorization": "Bearer hf_..."}
# and pass them in your requests.post(...) call.
payload = {"inputs": prompt}
response = requests.post(API_URL, json=payload)
return response.json()
demo = gr.Interface(
fn=query_model,
inputs="text",
outputs="text",
title="H4rmoniousBreeze",
description="Score narratives"
)
if __name__ == "__main__":
demo.launch()