Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,6 @@ import gradio as gr
|
|
3 |
|
4 |
df = pd.read_csv("images.csv")
|
5 |
df['url'] = df['url'].apply(lambda x: '<a href= "' + str(x) + '" target="_blank"> <img src= "' + str(x) + '"/> </a>') #'<img src= "' + str(x) + '"/> </a>')
|
6 |
-
#df['seed'] = df['seed'].apply(lambda x: str(x))
|
7 |
-
#df['width'] = df['width'].apply(lambda x: str(x))
|
8 |
-
#df['height'] = df['height'].apply(lambda x: str(x))
|
9 |
-
#df['steps'] = df['steps'].apply(lambda x: str(x))
|
10 |
-
#df['source'] = df['source'].apply(lambda x: str(x))
|
11 |
-
#df = df[[ 'url', 'prompt', 'seed', 'width', 'height', 'steps', 'source']]
|
12 |
-
#df = df[[ 'url', 'prompt', 'source']]
|
13 |
df = df[[ 'url', 'prompt']]
|
14 |
|
15 |
def display_df():
|
@@ -22,11 +15,9 @@ def display_next100(dataframe, end):
|
|
22 |
df_images = df.loc[start:end]
|
23 |
return df_images, end
|
24 |
|
25 |
-
#Gradio Blocks
|
26 |
with gr.Blocks() as demo:
|
27 |
gr.Markdown("<h1><center>AIPromptSearch</center></h1>")
|
28 |
-
gr.Markdown(
|
29 |
-
"""<div align="center">Images and Prompts from <a href = "https://playgroundai.com/">Playground AI</a> Images. Github:<a href="https://github.com/playgroundai/liked_images">Github</a>.""")
|
30 |
|
31 |
with gr.Row():
|
32 |
num_end = gr.Number(visible=False)
|
@@ -38,7 +29,5 @@ with gr.Blocks() as demo:
|
|
38 |
|
39 |
b1.click(fn=display_df, outputs=out_dataframe)
|
40 |
b2.click(fn=display_next100, inputs= [out_dataframe, num_end ], outputs=[out_dataframe, num_end])
|
41 |
-
|
42 |
-
#gr.Markdown("<center></center>")
|
43 |
-
|
44 |
demo.launch(debug=True, show_error=True)
|
|
|
3 |
|
4 |
df = pd.read_csv("images.csv")
|
5 |
df['url'] = df['url'].apply(lambda x: '<a href= "' + str(x) + '" target="_blank"> <img src= "' + str(x) + '"/> </a>') #'<img src= "' + str(x) + '"/> </a>')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
df = df[[ 'url', 'prompt']]
|
7 |
|
8 |
def display_df():
|
|
|
15 |
df_images = df.loc[start:end]
|
16 |
return df_images, end
|
17 |
|
|
|
18 |
with gr.Blocks() as demo:
|
19 |
gr.Markdown("<h1><center>AIPromptSearch</center></h1>")
|
20 |
+
gr.Markdown("""<div align="center">Images and Prompts from <a href = "https://playgroundai.com/">Playground AI</a>. <a href="https://github.com/playgroundai/liked_images">Github</a>.""")
|
|
|
21 |
|
22 |
with gr.Row():
|
23 |
num_end = gr.Number(visible=False)
|
|
|
29 |
|
30 |
b1.click(fn=display_df, outputs=out_dataframe)
|
31 |
b2.click(fn=display_next100, inputs= [out_dataframe, num_end ], outputs=[out_dataframe, num_end])
|
32 |
+
|
|
|
|
|
33 |
demo.launch(debug=True, show_error=True)
|