cstr commited on
Commit
3a2a0c1
1 Parent(s): 4299f2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -553,13 +553,14 @@ def send_to_model_impl(prompt, model_selection, hf_model_choice, hf_custom_model
553
 
554
  # Get the summary based on model selection
555
  if model_selection == "HuggingFace Inference":
556
- model_id = hf_custom_model if hf_model_choice == "Custom Model" else model_registry.hf_models[hf_model_choice]
 
557
  # Always try without API key first
558
  summary = send_to_hf_inference(prompt, model_id)
559
  if summary.startswith("Error: This model requires authentication") and hf_api_key:
560
  # Only try with API key if the model specifically requires it
561
  summary = send_to_hf_inference(prompt, model_id, hf_api_key, use_rate_limits)
562
-
563
  elif model_selection == "Groq API":
564
  if not groq_api_key:
565
  return gr.HTML(""), "Error: Groq API key required", None
 
553
 
554
  # Get the summary based on model selection
555
  if model_selection == "HuggingFace Inference":
556
+ # Use the selected model ID directly
557
+ model_id = hf_custom_model if hf_model_choice == "Custom Model" else hf_model_choice
558
  # Always try without API key first
559
  summary = send_to_hf_inference(prompt, model_id)
560
  if summary.startswith("Error: This model requires authentication") and hf_api_key:
561
  # Only try with API key if the model specifically requires it
562
  summary = send_to_hf_inference(prompt, model_id, hf_api_key, use_rate_limits)
563
+
564
  elif model_selection == "Groq API":
565
  if not groq_api_key:
566
  return gr.HTML(""), "Error: Groq API key required", None