Smartcomp commited on
Commit
8edb732
·
1 Parent(s): bb46f42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -1,11 +1,16 @@
1
-
2
- SYSTEM_PROMPT = "As an LLM, your job is to generate detailed prompts for an image generation model based on simple and short user inputs. Be creative and descriptive, but also make sure your prompts are clear and specific."
3
- TITLE = "Image Prompt Generator"
4
- EXAMPLE_INPUT = "A person riding a bicycle in a park on a sunny day."
5
  import gradio as gr
6
  import os
7
  import requests
8
 
 
 
 
 
 
 
9
  zephyr_7b_beta = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta/"
10
 
11
  HF_TOKEN = os.getenv("HF_TOKEN")
@@ -65,7 +70,7 @@ def test_preview_chatbot(message, history):
65
 
66
 
67
  welcome_preview_message = f"""
68
- Welcome to **{TITLE}**! Say something like:
69
 
70
  "{EXAMPLE_INPUT}"
71
  """
@@ -75,4 +80,5 @@ textbox_preview = gr.Textbox(scale=7, container=False, value=EXAMPLE_INPUT)
75
 
76
  demo = gr.ChatInterface(test_preview_chatbot, chatbot=chatbot_preview, textbox=textbox_preview)
77
 
78
- demo.launch()
 
 
1
+ SYSTEM_PROMPT = "As an LLM, your job is to generate detailed prompts that start with generate the image, for image generation models based on user input. Be descriptive and specific, but also make sure your prompts are clear and concise."
2
+ TITLE = "Image Prompter"
3
+ EXAMPLE_INPUT = "A reflective cat between stars."
 
4
  import gradio as gr
5
  import os
6
  import requests
7
 
8
+ html_temp = """
9
+ <div style="position: absolute; top: 0; right: 0;">
10
+ <img src='https://huggingface.co/spaces/NerdN/open-gpt-Image-Prompter/blob/main/_45a03b4d-ea0f-4b81-873d-ff6b10461d52.jpg' alt='Your Image' style='width:100px;height:100px;'>
11
+ </div>
12
+ """
13
+
14
  zephyr_7b_beta = "https://api-inference.huggingface.co/models/HuggingFaceH4/zephyr-7b-beta/"
15
 
16
  HF_TOKEN = os.getenv("HF_TOKEN")
 
70
 
71
 
72
  welcome_preview_message = f"""
73
+ Expand your imagination and broaden your horizons with LLM. Welcome to **{TITLE}**!:\nThis is a chatbot that can generate detailed prompts for image generation models based on simple and short user input.\nSay something like:
74
 
75
  "{EXAMPLE_INPUT}"
76
  """
 
80
 
81
  demo = gr.ChatInterface(test_preview_chatbot, chatbot=chatbot_preview, textbox=textbox_preview)
82
 
83
+
84
+ demo.launch(share=True)