tony-assi-lora / app.py
tonyassi's picture
Update app.py
d7024bf verified
raw
history blame
915 Bytes
import gradio as gr
import random
import requests
import io
from PIL import Image
API_URL = "https://api-inference.huggingface.co/models/tonyassi/tony-assi-lora-1"
headers = {"Authorization": "Bearer " + os.environ.get('TOKEN')}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.content
def generate(prompt):
return None
theme = gr.themes.Base(
primary_hue="gray",
secondary_hue="gray",
neutral_hue="gray",
font=['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
).set(
button_large_text_weight='400',
input_background_fill='#ffffff',
input_border_width='*block_border_width',
)
with gr.Blocks(theme=theme) as demo:
img = gr.Image(show_label=False, type='pil')
textbox = gr.Textbox(show_label=False)
button = gr.Button("generate")
button.click(fn=generate, inputs=textbox, outputs=img)
demo.launch()