prithivMLmods commited on
Commit
2550696
Β·
verified Β·
1 Parent(s): f2d8164

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -471,7 +471,7 @@ def generate(
471
  # --- 3D Generation branch ---
472
  if text.strip().lower().startswith("@3d"):
473
  prompt = text[len("@3d"):].strip()
474
- yield "πŸŒ€ Hold tight, generating a 3D mesh GLB file....."
475
  glb_path, used_seed = generate_3d_fn(
476
  prompt=prompt,
477
  seed=1,
@@ -493,7 +493,7 @@ def generate(
493
  # --- Image Generation branch ---
494
  if text.strip().lower().startswith("@image"):
495
  prompt = text[len("@image"):].strip()
496
- yield "⚑ Generating image β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
497
  image_paths, used_seed = generate_image_fn(
498
  prompt=prompt,
499
  negative_prompt="",
@@ -516,14 +516,14 @@ def generate(
516
  # If the command starts with "visit", then treat the rest as a URL
517
  if web_command.lower().startswith("visit"):
518
  url = web_command[len("visit"):].strip()
519
- yield "🌍 Visiting webpage..."
520
  visitor = VisitWebpageTool()
521
  content = visitor.forward(url)
522
  yield content
523
  else:
524
  # Otherwise, treat the rest as a search query.
525
  query = web_command
526
- yield "🧀 Performing a web search ..."
527
  searcher = DuckDuckGoSearchTool()
528
  results = searcher.forward(query)
529
  yield results
@@ -532,7 +532,7 @@ def generate(
532
  # --- rAgent Reasoning branch ---
533
  if text.strip().lower().startswith("@ragent"):
534
  prompt = text[len("@ragent"):].strip()
535
- yield "πŸ“ Initiating reasoning chain using Llama mode..."
536
  # Pass the current chat history (cleaned) to help inform the chain.
537
  for partial in ragent_reasoning(prompt, clean_chat_history(chat_history)):
538
  yield partial
@@ -540,7 +540,7 @@ def generate(
540
 
541
  # --- YOLO Object Detection branch ---
542
  if text.strip().lower().startswith("@yolo"):
543
- yield "πŸ” Running object detection with YOLO..."
544
  if not files or len(files) == 0:
545
  yield "Error: Please attach an image for YOLO object detection."
546
  return
@@ -615,7 +615,7 @@ def generate(
615
 
616
  # Stream the response
617
  buffer = ""
618
- yield "πŸ€” Processing with Phi-4..."
619
  for new_text in streamer:
620
  buffer += new_text
621
  time.sleep(0.01) # Small delay to simulate real-time streaming
@@ -659,7 +659,7 @@ def generate(
659
  thread.start()
660
 
661
  buffer = ""
662
- yield "πŸ€” Thinking..."
663
  for new_text in streamer:
664
  buffer += new_text
665
  buffer = buffer.replace("<|im_end|>", "")
 
471
  # --- 3D Generation branch ---
472
  if text.strip().lower().startswith("@3d"):
473
  prompt = text[len("@3d"):].strip()
474
+ yield " > Processing 3D Mesh Generation β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
475
  glb_path, used_seed = generate_3d_fn(
476
  prompt=prompt,
477
  seed=1,
 
493
  # --- Image Generation branch ---
494
  if text.strip().lower().startswith("@image"):
495
  prompt = text[len("@image"):].strip()
496
+ yield " > Processing Image Generation β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
497
  image_paths, used_seed = generate_image_fn(
498
  prompt=prompt,
499
  negative_prompt="",
 
516
  # If the command starts with "visit", then treat the rest as a URL
517
  if web_command.lower().startswith("visit"):
518
  url = web_command[len("visit"):].strip()
519
+ yield " > Processing Visiting webpage β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
520
  visitor = VisitWebpageTool()
521
  content = visitor.forward(url)
522
  yield content
523
  else:
524
  # Otherwise, treat the rest as a search query.
525
  query = web_command
526
+ yield " > Processing Web Query β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
527
  searcher = DuckDuckGoSearchTool()
528
  results = searcher.forward(query)
529
  yield results
 
532
  # --- rAgent Reasoning branch ---
533
  if text.strip().lower().startswith("@ragent"):
534
  prompt = text[len("@ragent"):].strip()
535
+ yield " > Processing reasoning chain using Llama mode β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
536
  # Pass the current chat history (cleaned) to help inform the chain.
537
  for partial in ragent_reasoning(prompt, clean_chat_history(chat_history)):
538
  yield partial
 
540
 
541
  # --- YOLO Object Detection branch ---
542
  if text.strip().lower().startswith("@yolo"):
543
+ yield " > Processing with yolo β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
544
  if not files or len(files) == 0:
545
  yield "Error: Please attach an image for YOLO object detection."
546
  return
 
615
 
616
  # Stream the response
617
  buffer = ""
618
+ yield " > Processing with phi4 multimodal β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
619
  for new_text in streamer:
620
  buffer += new_text
621
  time.sleep(0.01) # Small delay to simulate real-time streaming
 
659
  thread.start()
660
 
661
  buffer = ""
662
+ yield " > Processing with Qwen2VL Ocr β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’ 69%"
663
  for new_text in streamer:
664
  buffer += new_text
665
  buffer = buffer.replace("<|im_end|>", "")