TheHickman commited on
Commit
cdcdbc0
·
verified ·
1 Parent(s): 6c5a8de

Added all images

Browse files
Files changed (1) hide show
  1. app.py +30 -2
app.py CHANGED
@@ -8,6 +8,31 @@ with open("HFImage.png", "rb") as f:
8
 
9
  IMAGE_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
12
 
13
  # ---- GPT explanation backend ----
@@ -191,7 +216,7 @@ QUESTION_ANSWER = f"""
191
  Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document.
192
  Some question answering models can generate answers without context!
193
  </p>
194
- {IMAGE_HTML}
195
  <h1>About Question Answering</h1>
196
  <h2>Use Cases</h2>
197
  <h3>Frequently Asked Questions</h3>
@@ -240,7 +265,7 @@ SUMMARISATION = f"""
240
  Summarization is the task of producing a shorter version of a document while preserving its important information.
241
  Some models can extract text from the original input, while other models can generate entirely new text.
242
  </p>
243
- {IMAGE_HTML}
244
  <h1>About Summarisation</h1>
245
  <h2>Use Cases</h2>
246
  <h3>Research Paper Summarization 🧐</h3>
@@ -290,6 +315,7 @@ TEXT_2_IMAGGE = f"""
290
  <p>
291
  Text-to-image is the task of generating images from input text. These pipelines can also be used to modify and edit images based on text prompts.
292
  </p>
 
293
  <h1>About Text-to-Image</h1>
294
  <h2>Use Cases</h2>
295
  <h3>Data Generation</h3>
@@ -317,9 +343,11 @@ TEXT_2_IMAGGE = f"""
317
  <ul>
318
  <li><b>Synthetic image editing:</b> Adjusting images that were initially created using an input prompt while preserving the overall meaning or context of the original image.</li>
319
  </ul>
 
320
  <ul>
321
  <li>Real image editing: Similar to synthetic image editing, except we're using real photos/images. This task is usually more complex.</li>
322
  </ul>
 
323
  </p>
324
  <h3>Personalization</h3>
325
  <p>
 
8
 
9
  IMAGE_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
10
 
11
+ with open("QuestionAnswerTeaser.png", "rb") as f:
12
+ encoded = base64.b64encode(f.read()).decode()
13
+
14
+ QA_IMAGE_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
15
+
16
+ with open("SummarisationTeaser.png", "rb") as f:
17
+ encoded = base64.b64encode(f.read()).decode()
18
+
19
+ SUMMARISATION_IMAGGE_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
20
+
21
+ with open("Text2ImageTeaser.png", "rb") as f:
22
+ encoded = base64.b64encode(f.read()).decode()
23
+
24
+ TEXT2IMAGE_IMAGE_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
25
+
26
+ with open("SyntheticImage.png", "rb") as f:
27
+ encoded = base64.b64encode(f.read()).decode()
28
+
29
+ SYNTHETIC_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
30
+
31
+ with open("RealImage.jpeg", "rb") as f:
32
+ encoded = base64.b64encode(f.read()).decode()
33
+
34
+ REAL_HTML = f'<img src="data:image/png;base64,{encoded}" style="width:100%; border-radius:8px; margin-bottom:20px;" />'
35
+
36
  client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
37
 
38
  # ---- GPT explanation backend ----
 
216
  Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document.
217
  Some question answering models can generate answers without context!
218
  </p>
219
+ {QA_IMAGE_HTML}
220
  <h1>About Question Answering</h1>
221
  <h2>Use Cases</h2>
222
  <h3>Frequently Asked Questions</h3>
 
265
  Summarization is the task of producing a shorter version of a document while preserving its important information.
266
  Some models can extract text from the original input, while other models can generate entirely new text.
267
  </p>
268
+ {SUMMARISATION_IMAGGE_HTML}
269
  <h1>About Summarisation</h1>
270
  <h2>Use Cases</h2>
271
  <h3>Research Paper Summarization 🧐</h3>
 
315
  <p>
316
  Text-to-image is the task of generating images from input text. These pipelines can also be used to modify and edit images based on text prompts.
317
  </p>
318
+ {TEXT2IMAGE_IMAGE_HTML}
319
  <h1>About Text-to-Image</h1>
320
  <h2>Use Cases</h2>
321
  <h3>Data Generation</h3>
 
343
  <ul>
344
  <li><b>Synthetic image editing:</b> Adjusting images that were initially created using an input prompt while preserving the overall meaning or context of the original image.</li>
345
  </ul>
346
+ {SYNTHETIC_HTML}
347
  <ul>
348
  <li>Real image editing: Similar to synthetic image editing, except we're using real photos/images. This task is usually more complex.</li>
349
  </ul>
350
+ {REAL_HTML}
351
  </p>
352
  <h3>Personalization</h3>
353
  <p>