shukdevdatta123 commited on
Commit
3682b01
·
verified ·
1 Parent(s): 3fc0b8c

Update v3.txt

Browse files
Files changed (1) hide show
  1. v3.txt +29 -89
v3.txt CHANGED
@@ -284,7 +284,7 @@ def get_recipe_suggestions(api_key, image_paths, num_recipes=3, dietary_restrict
284
  {"role": "system", "content": system_prompt},
285
  {"role": "user", "content": user_prompt}
286
  ],
287
- max_tokens=2048,
288
  temperature=0.7
289
  )
290
 
@@ -508,7 +508,7 @@ body {
508
  padding: 0;
509
  }
510
  .container {
511
- max-width: 1200px;
512
  margin: 0 auto;
513
  padding: 20px;
514
  }
@@ -519,6 +519,7 @@ body {
519
  text-align: center;
520
  border-radius: 0 0 30px 30px;
521
  box-shadow: var(--box-shadow);
 
522
  }
523
  .app-title {
524
  font-size: 2.8em;
@@ -527,7 +528,7 @@ body {
527
  }
528
  .app-subtitle {
529
  font-size: 1.3em;
530
- font-weight: 300;
531
  max-width: 800px;
532
  margin: 0 auto;
533
  }
@@ -537,6 +538,7 @@ body {
537
  padding: 30px;
538
  box-shadow: var(--box-shadow);
539
  margin-bottom: 30px;
 
540
  }
541
  .section-header {
542
  font-size: 1.6em;
@@ -596,6 +598,7 @@ button.download-button {
596
  gap: 8px;
597
  margin-left: auto;
598
  margin-right: auto;
 
599
  }
600
  button.download-button:hover {
601
  background-color: #3da037;
@@ -658,43 +661,6 @@ button.download-button:hover {
658
  color: var(--primary-color);
659
  margin-bottom: 10px;
660
  }
661
- .loading-container {
662
- display: flex;
663
- flex-direction: column;
664
- justify-content: center;
665
- align-items: center;
666
- position: fixed;
667
- top: 0;
668
- left: 0;
669
- width: 100%;
670
- height: 100%;
671
- background-color: rgba(0, 0, 0, 0.5);
672
- z-index: 1000;
673
- opacity: 0;
674
- visibility: hidden;
675
- transition: opacity 0.3s ease, visibility 0.3s ease;
676
- }
677
- .loading-container.visible {
678
- opacity: 1;
679
- visibility: visible;
680
- }
681
- .loading-spinner {
682
- border: 8px solid #f3f3f3;
683
- border-top: 8px solid var(--primary-color);
684
- border-radius: 50%;
685
- width: 60px;
686
- height: 60px;
687
- animation: spin 1s linear infinite;
688
- }
689
- @keyframes spin {
690
- 0% { transform: rotate(0deg); }
691
- 100% { transform: rotate(360deg); }
692
- }
693
- .loading-text {
694
- color: white;
695
- font-size: 1.3em;
696
- margin-top: 20px;
697
- }
698
  .footer {
699
  background-color: var(--card-background);
700
  padding: 40px 20px;
@@ -702,6 +668,7 @@ button.download-button:hover {
702
  color: var(--text-color);
703
  font-size: 1.1em;
704
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
 
705
  }
706
  .footer-content {
707
  max-width: 800px;
@@ -727,19 +694,6 @@ html_header = """
727
  <div class="app-title">🍲 Visual Recipe Assistant</div>
728
  <div class="app-subtitle">Upload images of ingredients you have on hand and get personalized recipe suggestions powered by AI</div>
729
  </div>
730
- <div id="loading-overlay" class="loading-container">
731
- <div class="loading-spinner"></div>
732
- <div class="loading-text">Generating your recipes...</div>
733
- </div>
734
- <script>
735
- function showLoading() {
736
- document.getElementById('loading-overlay').classList.add('visible');
737
- }
738
-
739
- function hideLoading() {
740
- document.getElementById('loading-overlay').classList.remove('visible');
741
- }
742
- </script>
743
  """
744
 
745
  html_footer = """
@@ -749,47 +703,33 @@ html_footer = """
749
  <p>Powered by Meta's Llama-Vision-Free Model & Together AI</p>
750
  <p>Upload multiple ingredient images for more creative recipe combinations</p>
751
  <div class="footer-links">
752
- <a href="#" target="_blank">How It Works</a>
753
- <a href="#" target="_blank">Privacy Policy</a>
754
- <a href="#" target="_blank">Contact Us</a>
755
  </div>
756
  </div>
757
  </div>
758
- <script>
759
- document.addEventListener('DOMContentLoaded', function() {
760
- const submitBtn = document.querySelector('button.primary-button');
761
- if (submitBtn) {
762
- submitBtn.addEventListener('click', function() {
763
- showLoading();
764
- // Check every second for output content
765
- const checkInterval = setInterval(function() {
766
- const output = document.querySelector('.recipe-output');
767
- if (output && output.innerHTML.trim().length > 0) {
768
- hideLoading();
769
- clearInterval(checkInterval);
770
- clearTimeout(forceHideTimeout);
771
-
772
- // Show download button if it exists
773
- const downloadBtn = document.getElementById('download-button');
774
- if (downloadBtn) {
775
- downloadBtn.style.display = 'flex';
776
- }
777
- }
778
- }, 1000);
779
-
780
- // Force hide after 120 seconds
781
- const forceHideTimeout = setTimeout(function() {
782
- hideLoading();
783
- clearInterval(checkInterval);
784
- }, 120000);
785
- });
786
- }
787
- });
788
- </script>
789
  """
790
 
791
  with gr.Blocks(css=custom_css) as app:
792
  gr.HTML(html_header)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
793
 
794
  # Store the generated html file path for download
795
  html_file_path = gr.State(None)
@@ -856,7 +796,7 @@ with gr.Blocks(css=custom_css) as app:
856
  with gr.Group(elem_classes="output-section"):
857
  gr.HTML('<h3 class="section-header">Your Personalized Recipes</h3>')
858
  output = gr.HTML(elem_classes="recipe-output")
859
- download_button = gr.Button("📥 Download Recipes as HTML", elem_classes="download-button", visible=False, elem_id="download-button")
860
 
861
  gr.HTML(html_footer)
862
 
@@ -884,4 +824,4 @@ with gr.Blocks(css=custom_css) as app:
884
  )
885
 
886
  if __name__ == "__main__":
887
- app.launch()
 
284
  {"role": "system", "content": system_prompt},
285
  {"role": "user", "content": user_prompt}
286
  ],
287
+ max_tokens=20000,
288
  temperature=0.7
289
  )
290
 
 
508
  padding: 0;
509
  }
510
  .container {
511
+ width: 100%;
512
  margin: 0 auto;
513
  padding: 20px;
514
  }
 
519
  text-align: center;
520
  border-radius: 0 0 30px 30px;
521
  box-shadow: var(--box-shadow);
522
+ width: 100%;
523
  }
524
  .app-title {
525
  font-size: 2.8em;
 
528
  }
529
  .app-subtitle {
530
  font-size: 1.3em;
531
+ font-weight: 400;
532
  max-width: 800px;
533
  margin: 0 auto;
534
  }
 
538
  padding: 30px;
539
  box-shadow: var(--box-shadow);
540
  margin-bottom: 30px;
541
+ width: 100%;
542
  }
543
  .section-header {
544
  font-size: 1.6em;
 
598
  gap: 8px;
599
  margin-left: auto;
600
  margin-right: auto;
601
+ margin-bottom: 25px !important;
602
  }
603
  button.download-button:hover {
604
  background-color: #3da037;
 
661
  color: var(--primary-color);
662
  margin-bottom: 10px;
663
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  .footer {
665
  background-color: var(--card-background);
666
  padding: 40px 20px;
 
668
  color: var(--text-color);
669
  font-size: 1.1em;
670
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
671
+ width: 100%;
672
  }
673
  .footer-content {
674
  max-width: 800px;
 
694
  <div class="app-title">🍲 Visual Recipe Assistant</div>
695
  <div class="app-subtitle">Upload images of ingredients you have on hand and get personalized recipe suggestions powered by AI</div>
696
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  """
698
 
699
  html_footer = """
 
703
  <p>Powered by Meta's Llama-Vision-Free Model & Together AI</p>
704
  <p>Upload multiple ingredient images for more creative recipe combinations</p>
705
  <div class="footer-links">
706
+ <a href="#" onclick="document.getElementById('how-to-use').scrollIntoView({ behavior: 'smooth' }); return false;">How It Works</a>
707
+ <a href="https://api.whatsapp.com/send/?phone=%2B8801719296601&text&type=phone_number&app_absent=0" target="_blank">Contact Us</a>
 
708
  </div>
709
  </div>
710
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
711
  """
712
 
713
  with gr.Blocks(css=custom_css) as app:
714
  gr.HTML(html_header)
715
+
716
+ with gr.Accordion("How It Works", open=False, elem_id="how-to-use"):
717
+ gr.Markdown("""
718
+ ### Getting Started:
719
+ 1. Enter your OpenAI API key in the field below and click "Set API Key"
720
+ 2. Upload multiple PDF research papers (2 or more recommended)
721
+ 3. Enter your review question or topic
722
+ 4. Check the "Include Tables" option if you want the review to include comparison tables
723
+ 5. Click "Generate Systematic Review" to start the process
724
+ 6. After generation, you can download the review as HTML
725
+
726
+ ### Tips for Best Results:
727
+ - Upload papers that are related to the same research topic or field
728
+ - Be specific in your review question to get more focused results
729
+ - The generated review will follow a systematic structure including research field identification, data extraction, analysis, and conclusions
730
+ - The more papers you upload, the more comprehensive the review will be
731
+ - The review will be formatted as a professional academic paper with proper sections and citations
732
+ """)
733
 
734
  # Store the generated html file path for download
735
  html_file_path = gr.State(None)
 
796
  with gr.Group(elem_classes="output-section"):
797
  gr.HTML('<h3 class="section-header">Your Personalized Recipes</h3>')
798
  output = gr.HTML(elem_classes="recipe-output")
799
+ download_button = gr.Button("📥 Download Recipes (See below to download)", elem_classes="download-button", visible=False, elem_id="download-button")
800
 
801
  gr.HTML(html_footer)
802
 
 
824
  )
825
 
826
  if __name__ == "__main__":
827
+ app.launch()