Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,16 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def generate(prompt):
|
4 |
return None
|
@@ -15,7 +27,7 @@ theme = gr.themes.Base(
|
|
15 |
)
|
16 |
|
17 |
with gr.Blocks(theme=theme) as demo:
|
18 |
-
img = gr.Image(show_label=False)
|
19 |
textbox = gr.Textbox(show_label=False)
|
20 |
button = gr.Button("generate")
|
21 |
button.click(fn=generate, inputs=textbox, outputs=img)
|
|
|
1 |
import gradio as gr
|
2 |
+
import random
|
3 |
+
import requests
|
4 |
+
import io
|
5 |
+
from PIL import Image
|
6 |
+
|
7 |
+
API_URL = "https://api-inference.huggingface.co/models/tonyassi/tony-assi-lora-1"
|
8 |
+
headers = {"Authorization": "Bearer " + os.environ.get('TOKEN')}
|
9 |
+
|
10 |
+
def query(payload):
|
11 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
12 |
+
return response.content
|
13 |
+
|
14 |
|
15 |
def generate(prompt):
|
16 |
return None
|
|
|
27 |
)
|
28 |
|
29 |
with gr.Blocks(theme=theme) as demo:
|
30 |
+
img = gr.Image(show_label=False, type='pil')
|
31 |
textbox = gr.Textbox(show_label=False)
|
32 |
button = gr.Button("generate")
|
33 |
button.click(fn=generate, inputs=textbox, outputs=img)
|