Spaces:
Paused
Paused
Update app.py
Browse files8 unmodified lines91011121314512 unmodified lines527528529530531532533534535536537538539540541266 unmodified lines8088098108118128138148158168178188198208218228238248258268278288298 unmodified linesfrom huggingface_hub import InferenceClientfrom typing import Dict, List, Optional, Tupleimport time# 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")send_to_model_btn = gr.Button("π Send to Model", variant="primary")open_chatgpt_button = gr.Button("π Open ChatGPT")266 unmodified lines)# Download handlersfor 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)def download_file(content: str, prefix: str) -> List[str]:if not content:8 unmodified lines9101112131415512 unmodified lines528529530531532533534535536537538539540541542543266 unmodified lines8108118128138148158168178188198208218228238248258 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_registry.groq_models.keys()), # Use model_registry.groq_modelsvalue=list(model_registry.groq_models.keys())[0] if model_registry.groq_models else None, # Set a default value if availablelabel="Groq Model")groq_api_key = gr.Textbox(label="π Groq API Key",type="password")groq_refresh_btn = gr.Button("π Refresh Groq Models") # Add refresh buttonsend_to_model_btn = gr.Button("π Send to Model", variant="primary")open_chatgpt_button = gr.Button("π Open ChatGPT")266 unmodified lines)# Download handlerscopy_prompt_button.click(fn=None,_js=copy_text_js("generated_prompt"), # Use the helper functionoutputs=progress_status)copy_summary_button.click(fn=None,_js=copy_text_js("summary_output"), # Use the helper functionoutputs=progress_status)def download_file(content: str, prefix: str) -> List[str]:if not content:
app.py+21-25