Spaces:
Paused
Paused
Update app.py
Browse files8 unmodified lines9101112131415512 unmodified lines528529530530531532533534535536537538531532533534535536537538539540541542543266 unmodified lines8108118128118128138148158168178188198208218228238248258268138148158168178188198208218228238248258 unmodified linesfrom huggingface_hub import InferenceClientfrom typing import Dict, List, Optional, Tupleimport timefrom groq import Groq # Import the Groq client
# Set up logginglogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')512 unmodified lines ) with gr.Column(visible=False) as groq_options: groq_model = gr.Dropdown( choices=list(MODEL_CONTEXT_SIZES["Groq API"].keys()), value="mixtral-8x7b-32768", label="Groq Model" ) groq_api_key = gr.Textbox( label="π Groq API Key", type="password" ) groq_model = gr.Dropdown( choices=list(model_registry.groq_models.keys()), # Use model_registry.groq_models value=list(model_registry.groq_models.keys())[0] if model_registry.groq_models else None, # Set a default value if available label="Groq Model" ) groq_api_key = gr.Textbox( label="π Groq API Key", type="password" ) groq_refresh_btn = gr.Button("π Refresh Groq Models") # Add refresh button send_to_model_btn = gr.Button("π Send to Model", variant="primary") open_chatgpt_button = gr.Button("π Open ChatGPT")266 unmodified lines )
# Download handlers for btn, elem_id in [ (copy_prompt_button, "generated_prompt"), (copy_summary_button, "summary_output") ]: btn.click( fn=None, _js=f""" () => {{ const el = document.getElementById('{elem_id}'); if (!el) return 'Element not found'; navigator.clipboard.writeText(el.value); return 'Copied to clipboard!'; }} """, outputs=progress_status ) copy_prompt_button.click( fn=None, _js=copy_text_js("generated_prompt"), # Use the helper function outputs=progress_status ) copy_summary_button.click( fn=None, _js=copy_text_js("summary_output"), # Use the helper function outputs=progress_status )
def download_file(content: str, prefix: str) -> List[str]: if not content:app.py+21-25