Shaukat39 commited on
Commit
4fa7888
·
verified ·
1 Parent(s): d7a1a8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -59,6 +59,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
59
  return f"Error initializing agent: {e}", None
60
  # In the case of an app running as a hugging Face space, this link points toward your codebase ( usefull for others so please keep it public)
61
  agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
 
 
62
  print(agent_code)
63
 
64
  # 2. Fetch Questions
@@ -105,7 +107,12 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
105
  return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
106
 
107
  # 4. Prepare Submission
108
- submission_data = {"username": username.strip(), "agent_code": agent_code, "answers": answers_payload}
 
 
 
 
 
109
  status_update = f"Agent finished. Submitting {len(answers_payload)} answers for user '{username}'..."
110
  print(status_update)
111
 
 
59
  return f"Error initializing agent: {e}", None
60
  # In the case of an app running as a hugging Face space, this link points toward your codebase ( usefull for others so please keep it public)
61
  agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
62
+ agent_code = agent_code.strip()
63
+
64
  print(agent_code)
65
 
66
  # 2. Fetch Questions
 
107
  return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
108
 
109
  # 4. Prepare Submission
110
+
111
+ submission_data = {
112
+ "username": username.strip(),
113
+ "agent_code": agent_code.strip(), # <<< prevent newline issues here too
114
+ "answers": answers_payload
115
+ }
116
  status_update = f"Agent finished. Submitting {len(answers_payload)} answers for user '{username}'..."
117
  print(status_update)
118