Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -207,14 +207,12 @@ def send_to_model(prompt, model_selection, hf_model_choice, hf_custom_model, hf_
|
|
| 207 |
groq_model_choice, groq_api_key, openai_api_key, openai_model_choice):
|
| 208 |
"""Wrapper function for send_to_model_impl with proper error handling."""
|
| 209 |
|
| 210 |
-
logging.info("send to model
|
| 211 |
|
| 212 |
if not prompt or not prompt.strip():
|
| 213 |
return "Error: No prompt provided", None
|
| 214 |
|
| 215 |
try:
|
| 216 |
-
with gr.Progress() as progress:
|
| 217 |
-
progress(0, "Preparing to send to model...")
|
| 218 |
logging.info("sending to model preparation.")
|
| 219 |
|
| 220 |
# Basic input validation
|
|
@@ -230,7 +228,6 @@ def send_to_model(prompt, model_selection, hf_model_choice, hf_custom_model, hf_
|
|
| 230 |
return "Error: OpenAI API key required", None
|
| 231 |
|
| 232 |
# Call implementation with error handling
|
| 233 |
-
progress(0.5, "Processing with model...")
|
| 234 |
try:
|
| 235 |
logging.info("calling send_to_model_impl.")
|
| 236 |
summary, download_file = send_to_model_impl(
|
|
@@ -249,7 +246,6 @@ def send_to_model(prompt, model_selection, hf_model_choice, hf_custom_model, hf_
|
|
| 249 |
if summary is None or not isinstance(summary, str):
|
| 250 |
return "Error: No response from model", None
|
| 251 |
|
| 252 |
-
progress(1, "Complete!")
|
| 253 |
return summary, download_file
|
| 254 |
|
| 255 |
except Exception as e:
|
|
|
|
| 207 |
groq_model_choice, groq_api_key, openai_api_key, openai_model_choice):
|
| 208 |
"""Wrapper function for send_to_model_impl with proper error handling."""
|
| 209 |
|
| 210 |
+
logging.info("send to model starting..")
|
| 211 |
|
| 212 |
if not prompt or not prompt.strip():
|
| 213 |
return "Error: No prompt provided", None
|
| 214 |
|
| 215 |
try:
|
|
|
|
|
|
|
| 216 |
logging.info("sending to model preparation.")
|
| 217 |
|
| 218 |
# Basic input validation
|
|
|
|
| 228 |
return "Error: OpenAI API key required", None
|
| 229 |
|
| 230 |
# Call implementation with error handling
|
|
|
|
| 231 |
try:
|
| 232 |
logging.info("calling send_to_model_impl.")
|
| 233 |
summary, download_file = send_to_model_impl(
|
|
|
|
| 246 |
if summary is None or not isinstance(summary, str):
|
| 247 |
return "Error: No response from model", None
|
| 248 |
|
|
|
|
| 249 |
return summary, download_file
|
| 250 |
|
| 251 |
except Exception as e:
|