astronolan Claude commited on
Commit
cf36170
·
1 Parent(s): c89f65f

Fix gunicorn deployment: expose server at module level

Browse files

- Add module-level app and server initialization for gunicorn
- Fixes "Failed to find attribute 'server' in 'app'" error
- Maintains compatibility with local development via main()

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -129,5 +129,9 @@ def main():
129
  )
130
 
131
 
 
 
 
 
132
  if __name__ == "__main__":
133
  main()
 
129
  )
130
 
131
 
132
+ # For gunicorn/production deployment (Hugging Face Spaces)
133
+ app = create_app('aionsearchmodel.pt')
134
+ server = app.server
135
+
136
  if __name__ == "__main__":
137
  main()