Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import webbrowser
|
|
9 |
from huggingface_hub import InferenceClient
|
10 |
from typing import Dict, List, Optional, Tuple
|
11 |
import time
|
|
|
12 |
|
13 |
# Set up logging
|
14 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
@@ -527,15 +528,16 @@ with gr.Blocks(css="""
|
|
527 |
)
|
528 |
|
529 |
with gr.Column(visible=False) as groq_options:
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
|
|
539 |
|
540 |
send_to_model_btn = gr.Button("π Send to Model", variant="primary")
|
541 |
open_chatgpt_button = gr.Button("π Open ChatGPT")
|
@@ -808,22 +810,16 @@ with gr.Blocks(css="""
|
|
808 |
)
|
809 |
|
810 |
# Download handlers
|
811 |
-
|
812 |
-
|
813 |
-
(
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
navigator.clipboard.writeText(el.value);
|
822 |
-
return 'Copied to clipboard!';
|
823 |
-
}}
|
824 |
-
""",
|
825 |
-
outputs=progress_status
|
826 |
-
)
|
827 |
|
828 |
def download_file(content: str, prefix: str) -> List[str]:
|
829 |
if not content:
|
|
|
9 |
from huggingface_hub import InferenceClient
|
10 |
from typing import Dict, List, Optional, Tuple
|
11 |
import time
|
12 |
+
from groq import Groq # Import the Groq client
|
13 |
|
14 |
# Set up logging
|
15 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
528 |
)
|
529 |
|
530 |
with gr.Column(visible=False) as groq_options:
|
531 |
+
groq_model = gr.Dropdown(
|
532 |
+
choices=list(model_registry.groq_models.keys()), # Use model_registry.groq_models
|
533 |
+
value=list(model_registry.groq_models.keys())[0] if model_registry.groq_models else None, # Set a default value if available
|
534 |
+
label="Groq Model"
|
535 |
+
)
|
536 |
+
groq_api_key = gr.Textbox(
|
537 |
+
label="π Groq API Key",
|
538 |
+
type="password"
|
539 |
+
)
|
540 |
+
groq_refresh_btn = gr.Button("π Refresh Groq Models") # Add refresh button
|
541 |
|
542 |
send_to_model_btn = gr.Button("π Send to Model", variant="primary")
|
543 |
open_chatgpt_button = gr.Button("π Open ChatGPT")
|
|
|
810 |
)
|
811 |
|
812 |
# Download handlers
|
813 |
+
copy_prompt_button.click(
|
814 |
+
fn=None,
|
815 |
+
_js=copy_text_js("generated_prompt"), # Use the helper function
|
816 |
+
outputs=progress_status
|
817 |
+
)
|
818 |
+
copy_summary_button.click(
|
819 |
+
fn=None,
|
820 |
+
_js=copy_text_js("summary_output"), # Use the helper function
|
821 |
+
outputs=progress_status
|
822 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
823 |
|
824 |
def download_file(content: str, prefix: str) -> List[str]:
|
825 |
if not content:
|