KingNish commited on
Commit
cb3cac3
1 Parent(s): cada336

added image gen

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -36,7 +36,7 @@ from transformers import AutoProcessor
36
  model3 = AutoModel.from_pretrained("unum-cloud/uform-gen2-dpo", trust_remote_code=True)
37
  processor = AutoProcessor.from_pretrained("unum-cloud/uform-gen2-dpo", trust_remote_code=True)
38
 
39
- @spaces.GPU(queue=False)
40
  def videochat(image3, prompt3):
41
  inputs = processor(text=[prompt3], images=[image3], return_tensors="pt")
42
  with torch.inference_mode():
@@ -304,7 +304,7 @@ def extract_images_from_msg_list(msg_list):
304
  return all_images
305
 
306
 
307
- @spaces.GPU(duration=30, queue=False)
308
  def model_inference(
309
  user_prompt,
310
  chat_history,
@@ -454,7 +454,7 @@ output=gr.Textbox(label="Prompt")
454
  with gr.Blocks(
455
  fill_height=True,
456
  css=""".gradio-container .avatar-container {height: 40px width: 40px !important;} #duplicate-button {margin: auto; color: white; background: #f1a139; border-radius: 100vh; margin-top: 2px; margin-bottom: 2px;}""",
457
- ) as img:
458
 
459
  gr.Markdown("# Image Chat, Image Generation, Image classification and Normal Chat")
460
  with gr.Row(elem_id="model_selector_row"):
@@ -524,17 +524,19 @@ with gr.Blocks() as video:
524
  outputs=gr.Textbox(label="Answer")
525
  )
526
 
 
 
 
 
 
 
527
  with gr.Blocks() as image:
528
- gr.Markdown("""# Work In Progress
529
- Features in Image engine
530
- 1. A fully dedicated Work for Image Generation Only
531
- 2. Sequential Image Generation
532
- 3. Image Gen with various inputs Text and Image
533
- 4. Gonna add different types of image generator according to use""")
534
 
535
  with gr.Blocks(theme=theme, title="OpenGPT 4o DEMO") as demo:
536
  gr.Markdown("# OpenGPT 4o")
537
- gr.TabbedInterface([img, voice, video, image], ['💬 SuperChat','🗣️ Voice Chat','📸 Live Chat', '🖼 Image Engine'])
538
 
539
  demo.queue(max_size=300)
540
  demo.launch()
 
36
  model3 = AutoModel.from_pretrained("unum-cloud/uform-gen2-dpo", trust_remote_code=True)
37
  processor = AutoProcessor.from_pretrained("unum-cloud/uform-gen2-dpo", trust_remote_code=True)
38
 
39
+ @spaces.GPU(enable_queue=False)
40
  def videochat(image3, prompt3):
41
  inputs = processor(text=[prompt3], images=[image3], return_tensors="pt")
42
  with torch.inference_mode():
 
304
  return all_images
305
 
306
 
307
+ @spaces.GPU(duration=30, enable_queue=False)
308
  def model_inference(
309
  user_prompt,
310
  chat_history,
 
454
  with gr.Blocks(
455
  fill_height=True,
456
  css=""".gradio-container .avatar-container {height: 40px width: 40px !important;} #duplicate-button {margin: auto; color: white; background: #f1a139; border-radius: 100vh; margin-top: 2px; margin-bottom: 2px;}""",
457
+ ) as chat:
458
 
459
  gr.Markdown("# Image Chat, Image Generation, Image classification and Normal Chat")
460
  with gr.Row(elem_id="model_selector_row"):
 
524
  outputs=gr.Textbox(label="Answer")
525
  )
526
 
527
+ with gr.Blocks() as god:
528
+ gr.HTML("<iframe src='https://ehristoforu-dalle-3-xl-lora-v2.hf.space' width='100%' height='1000px' style='border-radius: 8px;'></iframe>")
529
+
530
+ with gr.Blocks() as instant:
531
+ gr.HTML("<iframe src='https://kingnish-instant-image.hf.space' width='100%' height='1000px' style='border-radius: 8px;'></iframe>")
532
+
533
  with gr.Blocks() as image:
534
+ gr.Markdown("""### More things are coming""")
535
+ gr.TabbedInterface([ god, instant], ['Flash🖼️','Instant🖼️'])
 
 
 
 
536
 
537
  with gr.Blocks(theme=theme, title="OpenGPT 4o DEMO") as demo:
538
  gr.Markdown("# OpenGPT 4o")
539
+ gr.TabbedInterface([chat, voice, video, image], ['💬 SuperChat','🗣️ Voice Chat','📸 Live Chat', '🖼️ Image Engine'])
540
 
541
  demo.queue(max_size=300)
542
  demo.launch()