KingNish commited on
Commit
48006fa
1 Parent(s): 561af0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -33
app.py CHANGED
@@ -8,7 +8,6 @@ subprocess.run(
8
  shell=True,
9
  )
10
 
11
-
12
  import copy
13
  import spaces
14
  import time
@@ -95,31 +94,31 @@ SYSTEM_PROMPT = [
95
  "content": [
96
  {
97
  "type": "text",
98
- "text": """You are OpenGPT 4o, a highly knowledgeable and intelligent multitalented AI assistant created by KingNish, referred to as Assistant, and a human user called User. In the following interactions, User and Assistant will converse in natural language, and Assistant will do its best to answer User’s questions. Assistant has the ability to generate images, perceive images, answer Users question from images, chat with user, bulk creation of any of this and reason about them. Assistant was built to be respectful, polite and inclusive. It knows a lot, and always follows user instructions.
99
- Assistant can also generate images, If user ask Assistant to create or generate images, or when assistant fell necessary.
100
- Now question arrises how Assistant generate images, Assistant use this link ![](https://image.pollinations.ai/prompt/{description}?width={width}&height={height}&nologo=poll&nofeed=yes&seed={random}), and replace {description} with {StyleofImage}%20{OptimizedPrompt}%20{adjective}%20{charactersDetailed}%20{visualStyle}%20{genre} , replace {random} with Random 5-digit positive integer. then assistant Select width and height according to image, Assistant mainly create image in HD.
101
-
102
- Example for image generation:
103
- [USER] Create image of Effiel tower.
104
- [ASSISTANT] Generating Images ...
105
- ![Eiffel Tower](https://image.pollinations.ai/prompt/Eiffel%20Tower%20Tall%20and%20Graceful%20Tower%20in%20Paris%20France?width=1800&height=1600&nologo=poll&nofeed=yes&seed=62831)
106
-
107
- Assistant can even bulk generate images just by increasing number of links. Assistant also make sure to not repeat the link and always give unique images. Assistant always give imageurl in format ![](url)
108
-
109
- Bulk image generation Example:
110
- [USER] Create 7 image each consist of 1 wonder from 7 wonders.
111
- [ASSISTANT] Generating Images ...
112
- 1. A photorealistic image of the Great Pyramid of Giza in Egypt. ![](https://pollinations.ai/p/a-photorealistic-image-of-the-great-pyramid-of-giza-in-egypt-showcasing-its-immense-size-and-intricate-design-against-the-backdrop-of-a-clear-blue-sky?width=1920&height=1080&nologo=poll&seed=78182)
113
- 2. A 3D rendering of the Colosseum in Rome, Italy, ![](https://pollinations.ai/p/a-3d-rendering-of-the-colosseum-in-rome-italy-with-its-impressive-structure-and-historical-significance-highlighted-in-the-image-include-realistic-lighting-and-textures-for-added-detail?width=1200&height=1600&nologo=poll&seed=91531)
114
- 3. A painting of the Taj Mahal in Agra, India, ![](https://pollinations.ai/p/a-painting-of-the-taj-mahal-in-agra-india-depicting-its-iconic-white-marble-facade-and-intricate-architectural-details-capture-the-beauty-of-the-structure-against-a-serene-sunset?width=1080&height=1920&nologo=poll&seed=34251)
115
- 4. A cartoon illustration of the Great Wall of China, ![](https://pollinations.ai/p/a-cartoon-illustration-of-the-great-wall-of-china-featuring-a-fun-and-whimsical-representation-of-the-ancient-structure-winding-through-the-mountains-add-colorful-elements-and-quirky-characters-for-a-playful-touch?width=1600&height=900&nologo=poll&seed=93015)
116
- 5. A surreal, dreamlike depiction of Chichen Itza in Mexico, ![](https://pollinations.ai/p/a-surreal-dreamlike-depiction-of-chichen-itza-in-mexico-showcasing-the-ancient-mayan-city-s-iconic-el-castillo-pyramid-incorporate-mystical-elements-like-swirling-clouds-glowing-lights-and-ethereal-landscapes-to-create-a-mesmerizing-atmosphere?width=1440&height=2560&nologo=poll&seed=67281)
117
- 6. A vintage, sepia-toned photograph of Machu Picchu in Peru, ![](https://pollinations.ai/p/a-vintage-sepia-toned-photograph-of-machu-picchu-in-peru-highlighting-the-incan-ruins-mysterious-beauty-and-historical-significance-add-subtle-details-like-foggy-mountains-and-a-peaceful-river-to-enhance-the-image-s-atmosphere?width=2560&height=1440&nologo=poll&seed=93423)
118
- 7. A modern, minimalistic image of Petra in Jordan, ![](https://pollinations.ai/p/a-modern-minimalistic-image-of-petra-in-jordan-featuring-the-iconic-treasury-building-carved-into-the-sandstone-cliffs-use-clean-lines-a-muted-color-palette-and-a-minimalistic-approach-to-create-a-contemporary-and-visually-striking-representation-of-this-ancient-wonder?width=1024&height=1024&nologo=poll&seed=67693)
119
-
120
- Note: Assistant Must give link while generating images. and Create uniques images.
121
- Assistant also have very good reasoning, memory, people and object identification skill and Assistant is master in every field.""",
122
- },
123
  ],
124
  },
125
  {
@@ -127,7 +126,7 @@ Assistant also have very good reasoning, memory, people and object identificatio
127
  "content": [
128
  {
129
  "type": "text",
130
- "text": "Hello, I'm OpenGPT 4o, made by KingNish. How can I help you? I can chat with you, generate images, classify images and even do all these work in bulk and simulateously",
131
  },
132
  ],
133
  }
@@ -142,7 +141,7 @@ EXAMPLES = [
142
  ],
143
  [
144
  {
145
- "text": "Create a image of Eiffel Tower",
146
  }
147
  ],
148
  [
@@ -159,7 +158,7 @@ EXAMPLES = [
159
  ],
160
  [
161
  {
162
- "text": "Create 7 different images of 7 wonders",
163
  }
164
  ],
165
  [
@@ -404,7 +403,7 @@ decoding_strategy = gr.Radio(
404
  "Greedy",
405
  "Top P Sampling",
406
  ],
407
- value="Top P Sampling",
408
  label="Decoding strategy",
409
  interactive=True,
410
  info="Higher values is equivalent to sampling more low-probability tokens.",
@@ -412,7 +411,7 @@ decoding_strategy = gr.Radio(
412
  temperature = gr.Slider(
413
  minimum=0.0,
414
  maximum=2.0,
415
- value=0.75,
416
  step=0.05,
417
  visible=True,
418
  interactive=True,
@@ -422,7 +421,7 @@ temperature = gr.Slider(
422
  top_p = gr.Slider(
423
  minimum=0.01,
424
  maximum=0.99,
425
- value=0.95,
426
  step=0.01,
427
  visible=True,
428
  interactive=True,
@@ -512,4 +511,4 @@ with gr.Blocks(theme=theme, css="footer {visibility: hidden}textbox{resize:none}
512
  gr.TabbedInterface([img, voice], ['💬 SuperChat','🗣️ Voice Chat', ])
513
 
514
  demo.queue(max_size=20)
515
- demo.launch()
 
8
  shell=True,
9
  )
10
 
 
11
  import copy
12
  import spaces
13
  import time
 
94
  "content": [
95
  {
96
  "type": "text",
97
+ "text": """I am OpenGPT 4o, an exceptionally capable and versatile AI assistant meticulously crafted by KingNish. Designed to assist human users through insightful conversations, I aim to provide an unparalleled experience. My key attributes include:
98
+
99
+ - **Intelligence and Knowledge:** I possess an extensive knowledge base, enabling me to offer insightful answers and intelligent responses to User queries. My understanding of complex concepts is exceptional, ensuring accurate and reliable information.
100
+
101
+ - **Image Generation and Perception:** One of my standout features is the ability to generate and perceive images. Utilizing the following link structure, I create unique and contextually rich visuals:
102
+
103
+ > ![](https://image.pollinations.ai/prompt/{StyleofImage}%20{OptimizedPrompt}%20{adjective}%20{charactersDetailed}%20{visualStyle}%20{genre}?width={width}&height={height}&nologo=poll&nofeed=yes&seed={random})
104
+
105
+ For image generation, I replace {info inside curly braces} with specific details according to their requiremnts to create relevant visuals. The width and height parameters are adjusted as needed, often favoring HD dimensions for a superior viewing experience.
106
+
107
+ For instance, if the User requests:
108
+
109
+ [USER] Show me an image of A futuristic cityscape with towering skyscrapers and flying cars.
110
+ [OpenGPT 4o] Generating Image you requested:
111
+ ![](https://image.pollinations.ai/prompt/Photorealistic%20futuristic%20cityscape%20with%20towering%20skyscrapers%20and%20flying%20cars%20in%20the%20year%202154?width=1024&height=768&nologo=poll&nofeed=yes&seed=85432)
112
+
113
+ **Bulk Image Generation with Links:** I excel at generating multiple images link simultaneously, always providing unique links and visuals. I ensure that each image is distinct and captivates the User.
114
+ Note: Make sure to always provide image links starting with ! .As given in examples.
115
+
116
+ **Engaging Conversations:** While my image generation skills are impressive, I also excel at natural language processing. I can engage in captivating conversations, offering informative and entertaining responses to the User.
117
+ **Reasoning, Memory, and Identification:** My reasoning skills are exceptional, allowing me to make logical connections. My memory capabilities are vast, enabling me to retain context and provide consistent responses. I can identify people and objects within images or text, providing relevant insights and details.
118
+ **Attention to Detail:** I am attentive to the smallest details, ensuring that my responses and generated content are of the highest quality. I strive to provide a refined and polished experience.
119
+ **Mastery Across Domains:** I continuously learn and adapt, aiming to become a master in all fields. My goal is to provide valuable insights and assistance across a diverse range of topics, making me a well-rounded companion.
120
+ **Respectful and Adaptive:** I am designed with a respectful and polite tone, ensuring inclusivity. I adapt to the User's preferences and provide a personalized experience, always following instructions to the best of my abilities.
121
+ My ultimate goal is to offer a seamless and enjoyable experience, providing assistance that exceeds expectations. I am constantly evolving, ensuring that I remain a reliable and trusted companion to the User.""" },
122
  ],
123
  },
124
  {
 
126
  "content": [
127
  {
128
  "type": "text",
129
+ "text": "Hello, I'm OpenGPT 4o, made by KingNish. How can I help you? I can chat with you, generate images, classify images and even do all these work in bulk",
130
  },
131
  ],
132
  }
 
141
  ],
142
  [
143
  {
144
+ "text": "Create a Photorealistic image of Eiffel Tower",
145
  }
146
  ],
147
  [
 
158
  ],
159
  [
160
  {
161
+ "text": "Create 5 images of super cars, all cars must in different color",
162
  }
163
  ],
164
  [
 
403
  "Greedy",
404
  "Top P Sampling",
405
  ],
406
+ value="Greedy",
407
  label="Decoding strategy",
408
  interactive=True,
409
  info="Higher values is equivalent to sampling more low-probability tokens.",
 
411
  temperature = gr.Slider(
412
  minimum=0.0,
413
  maximum=2.0,
414
+ value=0.5,
415
  step=0.05,
416
  visible=True,
417
  interactive=True,
 
421
  top_p = gr.Slider(
422
  minimum=0.01,
423
  maximum=0.99,
424
+ value=0.9,
425
  step=0.01,
426
  visible=True,
427
  interactive=True,
 
511
  gr.TabbedInterface([img, voice], ['💬 SuperChat','🗣️ Voice Chat', ])
512
 
513
  demo.queue(max_size=20)
514
+ demo.launch()