namberino commited on
Commit
fd5ec6c
·
1 Parent(s): 7b5875a

Debugging time

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -97,6 +97,8 @@ def call_generate(file_obj, topics, n_questions, difficulty, question_type):
97
  return {"error": "Could not read uploaded file (empty or unknown format)."}
98
  files = {"file": ("uploaded_file", file_bytes, "application/octet-stream")}
99
 
 
 
100
  data = {
101
  "topics": topics if topics is not None else "",
102
  "n_questions": str(n_questions),
@@ -108,6 +110,8 @@ def call_generate(file_obj, topics, n_questions, difficulty, question_type):
108
  resp = client.post("/generate/", files=files, data=data, timeout=120) # increase timeout if needed
109
  except Exception as e:
110
  return {"error": f"Request failed: {e}"}
 
 
111
 
112
  if resp.status_code != 200:
113
  # return helpful debug info
 
97
  return {"error": "Could not read uploaded file (empty or unknown format)."}
98
  files = {"file": ("uploaded_file", file_bytes, "application/octet-stream")}
99
 
100
+ print(files)
101
+
102
  data = {
103
  "topics": topics if topics is not None else "",
104
  "n_questions": str(n_questions),
 
110
  resp = client.post("/generate/", files=files, data=data, timeout=120) # increase timeout if needed
111
  except Exception as e:
112
  return {"error": f"Request failed: {e}"}
113
+
114
+ print(resp.status_code)
115
 
116
  if resp.status_code != 200:
117
  # return helpful debug info